Skip to content

Commit b54791d

Browse files
committed
Always recheck.
1 parent 1754dbb commit b54791d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

hstore_ops.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,16 @@ gin_consistent_hstore_hash(PG_FUNCTION_ARGS)
194194
bool res = true;
195195
int32 i;
196196

197+
/* All cases are inexact because of hashing */
198+
*recheck = true;
199+
197200
if (strategy == HStoreContainsStrategyNumber)
198201
{
199202
/*
200203
* Index doesn't have information about correspondence of keys and
201204
* values, so we need recheck. However, if not all the keys are
202205
* present, we can fail at once.
203206
*/
204-
*recheck = true;
205207
for (i = 0; i < nkeys; i++)
206208
{
207209
if (!check[i])
@@ -213,20 +215,14 @@ gin_consistent_hstore_hash(PG_FUNCTION_ARGS)
213215
}
214216
else if (strategy == HStoreExistsStrategyNumber)
215217
{
216-
/* Existence of key is guaranteed in default search mode */
217-
*recheck = false;
218218
res = true;
219219
}
220220
else if (strategy == HStoreExistsAnyStrategyNumber)
221221
{
222-
/* Existence of key is guaranteed in default search mode */
223-
*recheck = false;
224222
res = true;
225223
}
226224
else if (strategy == HStoreExistsAllStrategyNumber)
227225
{
228-
/* Testing for all the keys being present gives an exact result */
229-
*recheck = false;
230226
for (i = 0; i < nkeys; i++)
231227
{
232228
if (!check[i])

0 commit comments

Comments
 (0)