aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/spgist.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-03-10 18:36:49 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2012-03-10 18:36:49 -0500
commit03e56f798e365763486b03a2630fbc3190ccd29a (patch)
tree6fbcad7968eaad22de3a7dac6c45f2b8a82de099 /src/include/access/spgist.h
parent39d74e346c083aa371ba64c4edb1332c40b56530 (diff)
downloadpostgresql-03e56f798e365763486b03a2630fbc3190ccd29a.tar.gz
postgresql-03e56f798e365763486b03a2630fbc3190ccd29a.zip
Restructure SPGiST opclass interface API to support whole-index scans.
The original API definition was incapable of supporting whole-index scans because there was no way to invoke leaf-value reconstruction without checking any qual conditions. Also, it was inefficient for multiple-qual-condition scans because value reconstruction got done over again for each qual condition, and because other internal work in the consistent functions likewise had to be done for each qual. To fix these issues, pass the whole scankey array to the opclass consistent functions, instead of only letting them see one item at a time. (Essentially, the loop over scankey entries is now inside the consistent functions not outside them. This makes the consistent functions a bit more complicated, but not unreasonably so.) In itself this commit does nothing except save a few cycles in multiple-qual-condition index scans, since we can't support whole-index scans on SPGiST indexes until nulls are included in the index. However, I consider this a must-fix for 9.2 because once we release it will get very much harder to change the opclass API definition.
Diffstat (limited to 'src/include/access/spgist.h')
-rw-r--r--src/include/access/spgist.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/include/access/spgist.h b/src/include/access/spgist.h
index cd6de2c98da..8d0205e691f 100644
--- a/src/include/access/spgist.h
+++ b/src/include/access/spgist.h
@@ -128,8 +128,8 @@ typedef struct spgPickSplitOut
*/
typedef struct spgInnerConsistentIn
{
- StrategyNumber strategy; /* operator strategy number */
- Datum query; /* operator's RHS value */
+ ScanKey scankeys; /* array of operators and comparison values */
+ int nkeys; /* length of array */
Datum reconstructedValue; /* value reconstructed at parent */
int level; /* current level (counting from zero) */
@@ -156,8 +156,8 @@ typedef struct spgInnerConsistentOut
*/
typedef struct spgLeafConsistentIn
{
- StrategyNumber strategy; /* operator strategy number */
- Datum query; /* operator's RHS value */
+ ScanKey scankeys; /* array of operators and comparison values */
+ int nkeys; /* length of array */
Datum reconstructedValue; /* value reconstructed at parent */
int level; /* current level (counting from zero) */