Skip to content

Commit 7c8334b

Browse files
author
Artur Zakirov
committed
Clean code
1 parent 9038ba2 commit 7c8334b

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

rumget.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ callConsistentFn(RumState *rumstate, RumScanKey key)
8989

9090
key->outerAddInfoIsNull = true;
9191

92-
for(i = 0; i < key->nentries/*nuserentries*/; i++)
92+
for(i = 0; i < key->nentries; i++)
9393
{
9494
if (key->entryRes[i] && key->addInfoIsNull[0] == false)
9595
{
@@ -691,7 +691,8 @@ startScanEntry(RumState *rumstate, RumScanEntry entry)
691691
entry->isFinished = FALSE;
692692
}
693693
}
694-
else if (entry->searchMode == GIN_SEARCH_MODE_EVERYTHING)
694+
else if (entry->queryCategory == RUM_CAT_EMPTY_QUERY &&
695+
entry->searchMode == GIN_SEARCH_MODE_EVERYTHING)
695696
{
696697
btreeEntry.findItem(&btreeEntry, stackEntry);
697698
collectMatchRumKey(&btreeEntry, stackEntry, entry);

rumscan.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,10 @@ rumNewScanKey(IndexScanDesc scan)
419419
break;
420420
}
421421
/*
422-
* If there are no regular scan keys, generate an EMPTY scankey to
422+
* If there are no regular scan keys, generate an EVERYTHING scankey to
423423
* drive a full-index scan.
424424
*/
425-
if (so->nkeys == 0 && scan->numberOfOrderBys > 0 && !so->isVoidRes)
425+
if (so->nkeys == 0 && !so->isVoidRes)
426426
{
427427
hasNullQuery = true;
428428
rumFillScanKey(so, FirstOffsetNumber,
@@ -447,20 +447,6 @@ rumNewScanKey(IndexScanDesc scan)
447447
scan->numberOfOrderBys);
448448
}
449449

450-
/*
451-
* If there are no regular scan keys, generate an EVERYTHING scankey to
452-
* drive a full-index scan.
453-
*/
454-
if (so->nkeys == 0 && !so->isVoidRes)
455-
{
456-
hasNullQuery = true;
457-
rumFillScanKey(so, FirstOffsetNumber,
458-
InvalidStrategy,
459-
GIN_SEARCH_MODE_EVERYTHING,
460-
(Datum) 0, 0,
461-
NULL, NULL, NULL, NULL, false);
462-
}
463-
464450
MemoryContextSwitchTo(oldCtx);
465451

466452
pgstat_count_index_scan(scan->indexRelation);

0 commit comments

Comments
 (0)