Some questions about gin index

From: Andy Fan <zhihuifan1213(at)163(dot)com>
To: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Some questions about gin index
Date: 2025-06-04 12:10:06
Message-ID: 87tt4v7lnl.fsf@163.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hi,

When reading the code for Gin Index, there are lots of confusion about
some concepts, so here are some questions in my mind.

1. search mode.

/*
* searchMode settings for extractQueryFn.
*/
#define GIN_SEARCH_MODE_DEFAULT 0
#define GIN_SEARCH_MODE_INCLUDE_EMPTY 1
#define GIN_SEARCH_MODE_ALL 2
#define GIN_SEARCH_MODE_EVERYTHING 3 /* for internal use only */

2.

typedef struct GinScanEntryData
{
..
bool isPartialMatch;
..
}

3. requiredEntries / additionalEntries

typedef struct GinScanKeyData
{
/*
* At least one of the entries in requiredEntries must be present for a
* tuple to match the overall qual.
*
* additionalEntries contains entries that are needed by the consistent
* function to decide if an item matches, but are not sufficient to
* satisfy the qual without entries from requiredEntries.
*/
GinScanEntry *requiredEntries;
int nrequired;
GinScanEntry *additionalEntries;
int nadditional;
..
}

For all the 3 questions, the general question is what is X and how does
it play its role? I have read the gin/README before asking, so any help
is appreciated.

--
Best Regards
Andy Fan

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Xuneng Zhou 2025-06-04 12:33:30 Re: Proposal: Limitations of palloc inside checkpointer
Previous Message Tomas Vondra 2025-06-04 11:33:06 Re: strange perf regression with data checksums