Thread
-
Some questions about gin index
Andy Fan <zhihuifan1213@163.com> — 2025-06-04T12:10:06Z
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 -
Re: Some questions about gin index
Tom Lane <tgl@sss.pgh.pa.us> — 2025-06-05T19:44:11Z
Andy Fan <zhihuifan1213@163.com> writes: > When reading the code for Gin Index, there are lots of confusion about > some concepts, so here are some questions in my mind. At least some of these things are explained in gin.sgml. regards, tom lane
-
Re: Some questions about gin index
Andy Fan <zhihuifan1213@163.com> — 2025-06-06T09:32:02Z
Tom Lane <tgl@sss.pgh.pa.us> writes: > Andy Fan <zhihuifan1213@163.com> writes: >> When reading the code for Gin Index, there are lots of confusion about >> some concepts, so here are some questions in my mind. > > At least some of these things are explained in gin.sgml. I think the complexity of gin comes from the operators on the set of datum which is more complex than the operators on single datum. The gin.sgml provides some direction to research for me, thank for this hint! I should have paid more attention to sgml/* besides the gin/README... -- Best Regards Andy Fan