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

Commit5404e3e

Browse files
author
Arthur Zakirov
committed
Additional comments to RumScanKey and RumScanEntry
1 parent1685267 commit5404e3e

File tree

3 files changed

+17
-26
lines changed

3 files changed

+17
-26
lines changed

‎src/rum.h

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,10 @@ typedef struct RumScanKeyData
584584

585585
/* array of check flags, reported to consistentFn */
586586
bool*entryRes;
587+
/* array of additional information, used in consistentFn and orderingFn */
587588
Datum*addInfo;
588589
bool*addInfoIsNull;
590+
/* additional information, used in outerOrderingFn */
589591
booluseAddToColumn;
590592
DatumouterAddInfo;
591593
boolouterAddInfoIsNull;
@@ -616,7 +618,8 @@ typedef struct RumScanKeyData
616618
boolwillSort;/* just a copy of RumScanOpaqueData.willSort */
617619
ScanDirectionscanDirection;
618620

619-
RumScanKey*addInfoKeys;
621+
/* array of keys, used to scan using additional information as keys */
622+
RumScanKey*addInfoKeys;
620623
intaddInfoNKeys;
621624
}RumScanKeyData;
622625

@@ -638,9 +641,10 @@ typedef struct RumScanEntryData
638641
/* current ItemPointer to heap */
639642
RumItemcurItem;
640643

641-
/* for a partial-match or full-scan query, we accumulate all TIDs here */
642-
boolforceUseBitmap;
643-
/* or here if we need to store addinfo */
644+
/*
645+
* For a partial-match or full-scan query, we accumulate all TIDs and
646+
* and additional information here
647+
*/
644648
Tuplesortstate*matchSortstate;
645649
RumItemcollectRumItem;
646650

@@ -650,17 +654,20 @@ typedef struct RumScanEntryData
650654

651655
/* used for Posting list and one page in Posting tree */
652656
RumItem*list;
653-
MemoryContextcontext;
654657
int16nlist;
655658
int16offset;
656659

657-
ScanDirectionscanDirection;
660+
ScanDirectionscanDirection;
658661
boolisFinished;
659662
boolreduceResult;
660-
boolpreValue;
661663
uint32predictNumberResult;
664+
665+
/* used to scan posting tree */
662666
RumPostingTreeScan*gdi;
663667

668+
/* used in fast scan in addition to preConsistentFn */
669+
boolpreValue;
670+
664671
/* Find by AddInfo */
665672
booluseMarkAddInfo;
666673
RumItemmarkAddInfo;

‎src/rumget.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,6 @@ collectMatchBitmap(RumBtreeData * btree, RumBtreeStack * stack,
433433
scanEntry->predictNumberResult+=RumGetNPosting(itup);
434434
}
435435

436-
if (scanEntry->forceUseBitmap)
437-
return true;
438436
/*
439437
* Done with this entry, go to the next
440438
*/
@@ -529,7 +527,7 @@ startScanEntry(RumState * rumstate, RumScanEntry entry)
529527

530528
entry->isFinished= TRUE;
531529

532-
if (entry->isPartialMatch||entry->forceUseBitmap||
530+
if (entry->isPartialMatch||
533531
(entry->queryCategory==RUM_CAT_EMPTY_QUERY&&
534532
!entry->scanWithAddInfo))
535533
{
@@ -599,11 +597,6 @@ startScanEntry(RumState * rumstate, RumScanEntry entry)
599597
&entry->markAddInfo :NULL);
600598

601599
entry->gdi=gdi;
602-
entry->context=AllocSetContextCreate(CurrentMemoryContext,
603-
"RUM entry temporary context",
604-
ALLOCSET_DEFAULT_MINSIZE,
605-
ALLOCSET_DEFAULT_INITSIZE,
606-
ALLOCSET_DEFAULT_MAXSIZE);
607600

608601
/*
609602
* We keep buffer pinned because we need to prevent deletion of
@@ -779,7 +772,7 @@ startScan(IndexScanDesc scan)
779772
{
780773
RumScanEntryentry=so->entries[i];
781774

782-
if (entry->isPartialMatch||entry->forceUseBitmap)
775+
if (entry->isPartialMatch)
783776
{
784777
scanType=RumRegularScan;
785778
break;
@@ -1011,11 +1004,6 @@ entryGetNextItemList(RumState * rumstate, RumScanEntry entry)
10111004

10121005
entry->buffer=rumScanBeginPostingTree(gdi,NULL);
10131006
entry->gdi=gdi;
1014-
entry->context=AllocSetContextCreate(CurrentMemoryContext,
1015-
"RUM entry temporary context",
1016-
ALLOCSET_DEFAULT_MINSIZE,
1017-
ALLOCSET_DEFAULT_INITSIZE,
1018-
ALLOCSET_DEFAULT_MAXSIZE);
10191007

10201008
/*
10211009
* We keep buffer pinned because we need to prevent deletion of
@@ -1266,8 +1254,7 @@ compareCurRumItemScanDirection(RumState *rumstate, RumScanEntry entry,
12661254
RumItem*minItem)
12671255
{
12681256
returncompareRumItemScanDirection(rumstate,
1269-
(entry->forceUseBitmap) ?
1270-
InvalidAttrNumber :entry->attnumOrig,
1257+
entry->attnumOrig,
12711258
entry->scanDirection,
12721259
&entry->curItem,minItem);
12731260
}
@@ -1633,8 +1620,6 @@ entryFindItem(RumState * rumstate, RumScanEntry entry, RumItem * item)
16331620
return;
16341621
}
16351622

1636-
Assert(!entry->forceUseBitmap);
1637-
16381623
/* Try to find in loaded part of page */
16391624
if ((ScanDirectionIsForward(entry->scanDirection)&&
16401625
compareRumItem(rumstate,entry->attnumOrig,

‎src/rumscan.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ rumFillScanEntry(RumScanOpaque so, OffsetNumber attnum,
105105
scanEntry->strategy=strategy;
106106
scanEntry->searchMode=searchMode;
107107
scanEntry->attnum=scanEntry->attnumOrig=attnum;
108-
scanEntry->forceUseBitmap= false;
109108

110109
scanEntry->buffer=InvalidBuffer;
111110
RumItemSetMin(&scanEntry->curItem);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp