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

Commit9b5c8d4

Browse files
committed
Push index operator lossiness determination down to GIST/GIN opclass
"consistent" functions, and remove pg_amop.opreqcheck, as per recentdiscussion. The main immediate benefit of this is that we no longer need8.3's ugly hack of requiring @@@ rather than @@ to test weight-using tsquerysearches on GIN indexes. In future it should be possible to optimize someother queries better than is done now, by detecting at runtime whether theindex match is exact or not.Tom Lane, after an idea of Heikki's, and with some help from Teodor.
1 parent10be77c commit9b5c8d4

File tree

68 files changed

+1020
-782
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1020
-782
lines changed

‎contrib/btree_gist/btree_bit.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,17 @@ Datum
126126
gbt_bit_consistent(PG_FUNCTION_ARGS)
127127
{
128128
GISTENTRY*entry= (GISTENTRY*)PG_GETARG_POINTER(0);
129-
GBT_VARKEY*key= (GBT_VARKEY*)DatumGetPointer(entry->key);
130129
void*query= (void*)DatumGetByteaP(PG_GETARG_DATUM(1));
131130
StrategyNumberstrategy= (StrategyNumber)PG_GETARG_UINT16(2);
131+
/* Oidsubtype = PG_GETARG_OID(3); */
132+
bool*recheck= (bool*)PG_GETARG_POINTER(4);
132133
boolretval= FALSE;
134+
GBT_VARKEY*key= (GBT_VARKEY*)DatumGetPointer(entry->key);
133135
GBT_VARKEY_Rr=gbt_var_key_readable(key);
134136

137+
/* All cases served by this function are exact */
138+
*recheck= false;
139+
135140
if (GIST_LEAF(entry))
136141
retval=gbt_var_consistent(&r,query,&strategy, TRUE,&tinfo);
137142
else

‎contrib/btree_gist/btree_bytea.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,17 @@ Datum
9696
gbt_bytea_consistent(PG_FUNCTION_ARGS)
9797
{
9898
GISTENTRY*entry= (GISTENTRY*)PG_GETARG_POINTER(0);
99-
GBT_VARKEY*key= (GBT_VARKEY*)DatumGetPointer(entry->key);
10099
void*query= (void*)DatumGetByteaP(PG_GETARG_DATUM(1));
101100
StrategyNumberstrategy= (StrategyNumber)PG_GETARG_UINT16(2);
101+
/* Oidsubtype = PG_GETARG_OID(3); */
102+
bool*recheck= (bool*)PG_GETARG_POINTER(4);
102103
boolretval;
104+
GBT_VARKEY*key= (GBT_VARKEY*)DatumGetPointer(entry->key);
103105
GBT_VARKEY_Rr=gbt_var_key_readable(key);
104106

107+
/* All cases served by this function are exact */
108+
*recheck= false;
109+
105110
retval=gbt_var_consistent(&r,query,&strategy,GIST_LEAF(entry),&tinfo);
106111
PG_RETURN_BOOL(retval);
107112
}

‎contrib/btree_gist/btree_cash.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,14 @@ gbt_cash_consistent(PG_FUNCTION_ARGS)
9797
{
9898
GISTENTRY*entry= (GISTENTRY*)PG_GETARG_POINTER(0);
9999
Cashquery= (*((Cash*)PG_GETARG_POINTER(1)));
100+
StrategyNumberstrategy= (StrategyNumber)PG_GETARG_UINT16(2);
101+
/* Oidsubtype = PG_GETARG_OID(3); */
102+
bool*recheck= (bool*)PG_GETARG_POINTER(4);
100103
cashKEY*kkk= (cashKEY*)DatumGetPointer(entry->key);
101104
GBT_NUMKEY_Rkey;
102-
StrategyNumberstrategy= (StrategyNumber)PG_GETARG_UINT16(2);
105+
106+
/* All cases served by this function are exact */
107+
*recheck= false;
103108

104109
key.lower= (GBT_NUMKEY*)&kkk->lower;
105110
key.upper= (GBT_NUMKEY*)&kkk->upper;

‎contrib/btree_gist/btree_date.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,14 @@ gbt_date_consistent(PG_FUNCTION_ARGS)
113113
{
114114
GISTENTRY*entry= (GISTENTRY*)PG_GETARG_POINTER(0);
115115
DateADTquery=PG_GETARG_DATEADT(1);
116+
StrategyNumberstrategy= (StrategyNumber)PG_GETARG_UINT16(2);
117+
/* Oidsubtype = PG_GETARG_OID(3); */
118+
bool*recheck= (bool*)PG_GETARG_POINTER(4);
116119
dateKEY*kkk= (dateKEY*)DatumGetPointer(entry->key);
117120
GBT_NUMKEY_Rkey;
118-
StrategyNumberstrategy= (StrategyNumber)PG_GETARG_UINT16(2);
121+
122+
/* All cases served by this function are exact */
123+
*recheck= false;
119124

120125
key.lower= (GBT_NUMKEY*)&kkk->lower;
121126
key.upper= (GBT_NUMKEY*)&kkk->upper;

‎contrib/btree_gist/btree_float4.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,14 @@ gbt_float4_consistent(PG_FUNCTION_ARGS)
9696
{
9797
GISTENTRY*entry= (GISTENTRY*)PG_GETARG_POINTER(0);
9898
float4query=PG_GETARG_FLOAT4(1);
99+
StrategyNumberstrategy= (StrategyNumber)PG_GETARG_UINT16(2);
100+
/* Oidsubtype = PG_GETARG_OID(3); */
101+
bool*recheck= (bool*)PG_GETARG_POINTER(4);
99102
float4KEY*kkk= (float4KEY*)DatumGetPointer(entry->key);
100103
GBT_NUMKEY_Rkey;
101-
StrategyNumberstrategy= (StrategyNumber)PG_GETARG_UINT16(2);
104+
105+
/* All cases served by this function are exact */
106+
*recheck= false;
102107

103108
key.lower= (GBT_NUMKEY*)&kkk->lower;
104109
key.upper= (GBT_NUMKEY*)&kkk->upper;

‎contrib/btree_gist/btree_float8.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,16 @@ gbt_float8_compress(PG_FUNCTION_ARGS)
9595
Datum
9696
gbt_float8_consistent(PG_FUNCTION_ARGS)
9797
{
98-
9998
GISTENTRY*entry= (GISTENTRY*)PG_GETARG_POINTER(0);
10099
float8query=PG_GETARG_FLOAT8(1);
100+
StrategyNumberstrategy= (StrategyNumber)PG_GETARG_UINT16(2);
101+
/* Oidsubtype = PG_GETARG_OID(3); */
102+
bool*recheck= (bool*)PG_GETARG_POINTER(4);
101103
float8KEY*kkk= (float8KEY*)DatumGetPointer(entry->key);
102104
GBT_NUMKEY_Rkey;
103-
StrategyNumberstrategy= (StrategyNumber)PG_GETARG_UINT16(2);
105+
106+
/* All cases served by this function are exact */
107+
*recheck= false;
104108

105109
key.lower= (GBT_NUMKEY*)&kkk->lower;
106110
key.upper= (GBT_NUMKEY*)&kkk->upper;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp