mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-24 18:55:04 +08:00
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
This commit is contained in:
parent
ab77485945
commit
d4635b16fe
@ -1937,13 +1937,16 @@ show_tidbitmap_info(BitmapHeapScanState *planstate, ExplainState *es)
|
||||
}
|
||||
else
|
||||
{
|
||||
appendStringInfoSpaces(es->str, es->indent * 2);
|
||||
appendStringInfoString(es->str, "Heap Blocks:");
|
||||
if (planstate->exact_pages > 0)
|
||||
appendStringInfo(es->str, " exact=%ld", planstate->exact_pages);
|
||||
if (planstate->lossy_pages > 0)
|
||||
appendStringInfo(es->str, " lossy=%ld", planstate->lossy_pages);
|
||||
appendStringInfoChar(es->str, '\n');
|
||||
if (planstate->exact_pages > 0 || planstate->lossy_pages > 0)
|
||||
{
|
||||
appendStringInfoSpaces(es->str, es->indent * 2);
|
||||
appendStringInfoString(es->str, "Heap Blocks:");
|
||||
if (planstate->exact_pages > 0)
|
||||
appendStringInfo(es->str, " exact=%ld", planstate->exact_pages);
|
||||
if (planstate->lossy_pages > 0)
|
||||
appendStringInfo(es->str, " lossy=%ld", planstate->lossy_pages);
|
||||
appendStringInfoChar(es->str, '\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user