Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7340d93

Browse files
committed
Widen lossy and exact page counters for Bitmap Heap Scan
Both of these counters were using the "long" data type. On MSVC that'sa 32-bit type. On modern hardware, I was able to demonstrate that we canwrap those counters with a query that only takes 15 minutes to run.This issue may manifest itself either by not showing the values of thecounters because they've wrapped and are less than zero, resulting inthem being filtered by the > 0 checks in show_tidbitmap_info(), or bogusnumbers being displayed which are modulus 2^32 of the actual number.Widen these counters to uint64.Discussion:https://postgr.es/m/CAApHDvpS_97TU+jWPc=T83WPp7vJa1dTw3mojEtAVEZOWh9bjQ@mail.gmail.com
1 parentd7db04d commit7340d93

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

‎src/backend/commands/explain.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3635,10 +3635,10 @@ show_tidbitmap_info(BitmapHeapScanState *planstate, ExplainState *es)
36353635
{
36363636
if (es->format!=EXPLAIN_FORMAT_TEXT)
36373637
{
3638-
ExplainPropertyInteger("Exact Heap Blocks",NULL,
3639-
planstate->exact_pages,es);
3640-
ExplainPropertyInteger("Lossy Heap Blocks",NULL,
3641-
planstate->lossy_pages,es);
3638+
ExplainPropertyUInteger("Exact Heap Blocks",NULL,
3639+
planstate->exact_pages,es);
3640+
ExplainPropertyUInteger("Lossy Heap Blocks",NULL,
3641+
planstate->lossy_pages,es);
36423642
}
36433643
else
36443644
{
@@ -3647,9 +3647,9 @@ show_tidbitmap_info(BitmapHeapScanState *planstate, ExplainState *es)
36473647
ExplainIndentText(es);
36483648
appendStringInfoString(es->str,"Heap Blocks:");
36493649
if (planstate->exact_pages>0)
3650-
appendStringInfo(es->str," exact=%ld",planstate->exact_pages);
3650+
appendStringInfo(es->str," exact="UINT64_FORMAT,planstate->exact_pages);
36513651
if (planstate->lossy_pages>0)
3652-
appendStringInfo(es->str," lossy=%ld",planstate->lossy_pages);
3652+
appendStringInfo(es->str," lossy="UINT64_FORMAT,planstate->lossy_pages);
36533653
appendStringInfoChar(es->str,'\n');
36543654
}
36553655
}

‎src/include/nodes/execnodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,8 +1817,8 @@ typedef struct BitmapHeapScanState
18171817
TBMIterator*tbmiterator;
18181818
TBMIterateResult*tbmres;
18191819
Bufferpvmbuffer;
1820-
longexact_pages;
1821-
longlossy_pages;
1820+
uint64exact_pages;
1821+
uint64lossy_pages;
18221822
TBMIterator*prefetch_iterator;
18231823
intprefetch_pages;
18241824
intprefetch_target;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp