mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +03:00
Reduce btree scan overhead for < and > strategies
For <, <=, > and >= strategies, mark the first scan key as already matched if scanning in an appropriate direction. If index tuple contains no nulls we can skip the first re-check for each tuple. Author: Rajeev Rastogi Reviewer: Haribabu Kommi Rework of the code and comments by Simon Riggs
This commit is contained in:
@@ -618,6 +618,7 @@ typedef BTScanOpaqueData *BTScanOpaque;
|
||||
*/
|
||||
#define SK_BT_REQFWD 0x00010000 /* required to continue forward scan */
|
||||
#define SK_BT_REQBKWD 0x00020000 /* required to continue backward scan */
|
||||
#define SK_BT_MATCHED 0x00040000 /* required to skip further key match */
|
||||
#define SK_BT_INDOPTION_SHIFT 24 /* must clear the above bits */
|
||||
#define SK_BT_DESC (INDOPTION_DESC << SK_BT_INDOPTION_SHIFT)
|
||||
#define SK_BT_NULLS_FIRST (INDOPTION_NULLS_FIRST << SK_BT_INDOPTION_SHIFT)
|
||||
|
||||
Reference in New Issue
Block a user