improve query

This commit is contained in:
jetgm 2023-10-23 09:56:19 +08:00
parent bde5c5a4a8
commit 6fbc5277b6

View File

@ -120,7 +120,9 @@ String InterpreterShowTablesQuery::getRewrittenQuery()
if (query.merges)
{
WriteBufferFromOwnString rewritten_query;
rewritten_query << "SELECT table, database, elapsed, merge_type FROM system.merges";
rewritten_query << "SELECT table, database, round((elapsed * (1 / progress)) - elapsed, 2) AS estimate_complete, elapsed, "
"round(progress, 2) AS progress, is_mutation, formatReadableSize(total_size_bytes_compressed) AS size, "
"formatReadableSize(memory_usage) AS mem FROM system.merges";
if (!query.like.empty())
{