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

Commit8e850b9

Browse files
committed
Advance multiple array keys rightmost-first instead of leftmost-first
during a bitmap index scan. This cannot affect the query results(since we're just dumping the TIDs into a bitmap) but it might offersome advantage in locality of access to the index. Per Greg Stark.
1 parenta2f1827 commit8e850b9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎src/backend/executor/nodeIndexscan.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.125 2008/01/01 19:45:49 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.126 2008/03/18 03:54:52 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -352,7 +352,13 @@ ExecIndexAdvanceArrayKeys(IndexArrayKeyInfo *arrayKeys, int numArrayKeys)
352352
boolfound= false;
353353
intj;
354354

355-
for (j=0;j<numArrayKeys;j++)
355+
/*
356+
* Note we advance the rightmost array key most quickly, since it will
357+
* correspond to the lowest-order index column among the available
358+
* qualifications. This is hypothesized to result in better locality
359+
* of access in the index.
360+
*/
361+
for (j=numArrayKeys-1;j >=0;j--)
356362
{
357363
ScanKeyscan_key=arrayKeys[j].scan_key;
358364
intnext_elem=arrayKeys[j].next_elem;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp