aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistbuild.c
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2023-10-06 10:40:51 +0300
committerAlexander Korotkov <akorotkov@postgresql.org>2023-10-06 10:40:51 +0300
commite0b1ee17dc3a38ba17fee0fd58b7b834ec934259 (patch)
tree1bd2c85029269e36cc1321aafcc6c7dd57ee37a3 /src/backend/access/gist/gistbuild.c
parent5da0a622e88907722ce456d30dbf0565ed7a222b (diff)
downloadpostgresql-e0b1ee17dc3a38ba17fee0fd58b7b834ec934259.tar.gz
postgresql-e0b1ee17dc3a38ba17fee0fd58b7b834ec934259.zip
Skip checking of scan keys required for directional scan in B-tree
Currently, B-tree code matches every scan key to every item on the page. Imagine the ordered B-tree scan for the query like this. SELECT * FROM tbl WHERE col > 'a' AND col < 'b' ORDER BY col; The (col > 'a') scan key will be always matched once we find the location to start the scan. The (col < 'b') scan key will match every item on the page as long as it matches the last item on the page. This patch implements prechecking of the scan keys required for directional scan on beginning of page scan. If precheck is successful we can skip this scan keys check for the items on the page. That could lead to significant acceleration especially if the comparison operator is expensive. Idea from patch by Konstantin Knizhnik. Discussion: https://postgr.es/m/079c3f8e-3371-abe2-e93c-fc8a0ae3f571%40garret.ru Reviewed-by: Peter Geoghegan, Pavel Borisov
Diffstat (limited to 'src/backend/access/gist/gistbuild.c')
0 files changed, 0 insertions, 0 deletions