Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 543f57f

Browse files
committed
Prevent bitmap heap scans from showing unnecessary block info in EXPLAIN ANALYZE.
EXPLAIN ANALYZE shows the information of the numbers of exact/lossy blocks which bitmap heap scan processes. But, previously, when those numbers were both zero, it displayed only the prefix "Heap Blocks:" in TEXT output format. This is strange and would confuse the users. So this commit suppresses such unnecessary information. Backpatch to 9.4 where EXPLAIN ANALYZE was changed so that such information was displayed. Etsuro Fujita
1 parent 22ccce5 commit 543f57f

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/backend/commands/explain.c

+10-7
Original file line numberDiff line numberDiff line change
@@ -1937,13 +1937,16 @@ show_tidbitmap_info(BitmapHeapScanState *planstate, ExplainState *es)
19371937
}
19381938
else
19391939
{
1940-
appendStringInfoSpaces(es->str, es->indent * 2);
1941-
appendStringInfoString(es->str, "Heap Blocks:");
1942-
if (planstate->exact_pages > 0)
1943-
appendStringInfo(es->str, " exact=%ld", planstate->exact_pages);
1944-
if (planstate->lossy_pages > 0)
1945-
appendStringInfo(es->str, " lossy=%ld", planstate->lossy_pages);
1946-
appendStringInfoChar(es->str, '\n');
1940+
if (planstate->exact_pages > 0 || planstate->lossy_pages > 0)
1941+
{
1942+
appendStringInfoSpaces(es->str, es->indent * 2);
1943+
appendStringInfoString(es->str, "Heap Blocks:");
1944+
if (planstate->exact_pages > 0)
1945+
appendStringInfo(es->str, " exact=%ld", planstate->exact_pages);
1946+
if (planstate->lossy_pages > 0)
1947+
appendStringInfo(es->str, " lossy=%ld", planstate->lossy_pages);
1948+
appendStringInfoChar(es->str, '\n');
1949+
}
19471950
}
19481951
}
19491952

0 commit comments

Comments
 (0)