Fix an oversight in refactoring in 06b10f80ba4.
authorAlexander Korotkov <[email protected]>
Fri, 22 Mar 2024 13:25:53 +0000 (15:25 +0200)
committerAlexander Korotkov <[email protected]>
Fri, 22 Mar 2024 13:25:53 +0000 (15:25 +0200)
It was against intended skipping prechecking keys optimization in the
first page of range queries to not influence point queries performance.

Reported-by: Anton Melnikov
Discussion: https://postgr.es/m/30cd7524-b9f1-4cf8-9c4a-223eb2e34441%40postgrespro.ru
Author: Pavel Borisov

src/backend/access/nbtree/nbtsearch.c

index 23e723a233cb231ff2be3df838b46cfefc3f7615..e3fff90d8e421a119c2b3e7290bdc89a381c29d0 100644 (file)
@@ -2498,7 +2498,7 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
    /*
     * Now load data from the first page of the scan.
     */
-   if (!_bt_readpage(scan, dir, start, false))
+   if (!_bt_readpage(scan, dir, start, true))
    {
        /*
         * There's no actually-matching data on this page.  Try to advance to