46 bool killedsomething =
false;
83 killedsomething =
true;
130 bool *recheck_distances_p)
140 *recheck_distances_p =
false;
152 elog(
ERROR,
"invalid GiST tuple found on leaf page");
169 giststate->leafTupdesc,
203 datum, r, page, offset,
231 *recheck_p |= recheck;
249 giststate->leafTupdesc,
255 distance_p->value = 0.0;
256 distance_p->isnull =
true;
265 datum, r, page, offset,
292 *recheck_distances_p |= recheck;
294 distance_p->isnull =
false;
365 Assert(myDistances != NULL);
371 item->
blkno = opaque->rightlink;
419 bool recheck_distances;
437 &recheck, &recheck_distances);
617 elog(
ERROR,
"GiST only supports forward scan direction");
761 memset(&fakeItem.data.parentlsn, 0,
sizeof(
GistNSN));
#define InvalidBlockNumber
BlockNumber BufferGetBlockNumber(Buffer buffer)
XLogRecPtr BufferGetLSNAtomic(Buffer buffer)
void UnlockReleaseBuffer(Buffer buffer)
void LockBuffer(Buffer buffer, int mode)
void MarkBufferDirtyHint(Buffer buffer, bool buffer_std)
Buffer ReadBuffer(Relation reln, BlockNumber blockNum)
static Page BufferGetPage(Buffer buffer)
static bool BufferIsValid(Buffer bufnum)
static Item PageGetItem(Page page, ItemId itemId)
static ItemId PageGetItemId(Page page, OffsetNumber offsetNumber)
static OffsetNumber PageGetMaxOffsetNumber(Page page)
#define Assert(condition)
#define OidIsValid(objectId)
static void PGresult * res
static float8 get_float8_infinity(void)
Datum FunctionCall5Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5)
#define GIST_COMPRESS_PROC
#define GistPageIsLeaf(page)
#define GistFollowRight(page)
#define GistPageIsDeleted(page)
#define GistPageGetOpaque(page)
#define GistMarkPageHasGarbage(page)
#define GistPageGetNSN(page)
GISTScanOpaqueData * GISTScanOpaque
#define SizeOfGISTSearchItem(n_distances)
#define GistTupleIsInvalid(itup)
#define GISTSearchItemIsHeap(item)
static bool getNextNearest(IndexScanDesc scan)
static bool gistindex_keytest(IndexScanDesc scan, IndexTuple tuple, Page page, OffsetNumber offset, bool *recheck_p, bool *recheck_distances_p)
bool gistgettuple(IndexScanDesc scan, ScanDirection dir)
int64 gistgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
static GISTSearchItem * getNextGISTSearchItem(GISTScanOpaque so)
bool gistcanreturn(Relation index, int attno)
static void gistScanPage(IndexScanDesc scan, GISTSearchItem *pageItem, IndexOrderByDistance *myDistances, TIDBitmap *tbm, int64 *ntids)
static void gistkillitems(IndexScanDesc scan)
HeapTuple gistFetchTuple(GISTSTATE *giststate, Relation r, IndexTuple tuple)
void gistdentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e, Datum k, Relation r, Page pg, OffsetNumber o, bool l, bool isNull)
void gistcheckpage(Relation rel, Buffer buf)
RegProcedure index_getprocid(Relation irel, AttrNumber attnum, uint16 procnum)
void index_store_float8_orderby_distances(IndexScanDesc scan, Oid *orderByTypes, IndexOrderByDistance *distances, bool recheckOrderBy)
if(TABLE==NULL||TABLE_index==NULL)
#define ItemIdMarkDead(itemId)
#define ItemIdIsDead(itemId)
static BlockNumber ItemPointerGetBlockNumber(const ItemPointerData *pointer)
IndexTupleData * IndexTuple
static Datum index_getattr(IndexTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
#define MaxIndexTuplesPerPage
void MemoryContextReset(MemoryContext context)
void pfree(void *pointer)
#define CHECK_FOR_INTERRUPTS()
#define OffsetNumberNext(offsetNumber)
#define FirstOffsetNumber
void pairingheap_add(pairingheap *heap, pairingheap_node *node)
pairingheap_node * pairingheap_remove_first(pairingheap *heap)
#define pairingheap_is_empty(h)
#define pgstat_count_index_scan(rel)
static bool DatumGetBool(Datum X)
static Datum PointerGetDatum(const void *X)
static Datum Int16GetDatum(int16 X)
static float8 DatumGetFloat8(Datum X)
static Datum ObjectIdGetDatum(Oid X)
void PredicateLockPage(Relation relation, BlockNumber blkno, Snapshot snapshot)
MemoryContextSwitchTo(old_ctx)
#define IndexRelationGetNumberOfKeyAttributes(relation)
OffsetNumber * killedItems
GISTSearchHeapItem pageData[BLCKSZ/sizeof(IndexTupleData)]
IndexOrderByDistance * distances
MemoryContext pageDataCxt
union GISTSearchItem::@44 data
IndexOrderByDistance distances[FLEXIBLE_ARRAY_MEMBER]
struct ScanKeyData * keyData
struct ScanKeyData * orderByData
bool ignore_killed_tuples
ItemPointerData xs_heaptid
struct SnapshotData * xs_snapshot
void tbm_add_tuples(TIDBitmap *tbm, const ItemPointer tids, int ntids, bool recheck)
#define XLogRecPtrIsInvalid(r)