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

Commit473411f

Browse files
Avoid extra lookups with nbtree array inequalities.
nbtree index scans with SAOP inequalities (but no SAOP equalities)performed extra ORDER proc lookups for any remaining equality strategyscan keys. This could waste cycles, and caused assertion failures.Keeping around a separate ORDER proc is only necessary for a scan'snon-array/non-SAOP equality scan keys when the scan has at least oneother SAOP equality strategy key (a SAOP inequality shouldn't count).To fix, replace _bt_preprocess_array_keys_final's assertion with a testthat makes the function return early when the scan has no SAOP equalityscan keys.Oversight in commit1b134ca, which enhanced nbtree ScalarArrayOpexecution.Reported-By: Alexander Lakhin <exclusion@gmail.com>Discussion:https://postgr.es/m/0539d3d3-a402-0a49-ed5e-26429dffc4bd@gmail.com
1 parenta475a2f commit473411f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎src/backend/access/nbtree/nbtutils.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,13 @@ _bt_preprocess_array_keys_final(IndexScanDesc scan, int *keyDataMap)
557557
intlast_equal_output_ikeyPG_USED_FOR_ASSERTS_ONLY=-1;
558558

559559
Assert(so->qual_ok);
560-
Assert(so->numArrayKeys);
560+
561+
/*
562+
* Nothing for us to do when _bt_preprocess_array_keys only had to deal
563+
* with array inequalities
564+
*/
565+
if (so->numArrayKeys==0)
566+
return;
561567

562568
for (intoutput_ikey=0;output_ikey<so->numberOfKeys;output_ikey++)
563569
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp