diff options
| author | Teodor Sigaev <teodor@sigaev.ru> | 2007-01-31 15:09:45 +0000 |
|---|---|---|
| committer | Teodor Sigaev <teodor@sigaev.ru> | 2007-01-31 15:09:45 +0000 |
| commit | d4c6da152782b580b24cd8b4054eb1b7fb72c5a0 (patch) | |
| tree | 23db426588b5ff2a39981393a3cc4b48397b4294 /src/include/access | |
| parent | 147a3ce149088c913b152e7d37bb92f61bb068dd (diff) | |
| download | postgresql-d4c6da152782b580b24cd8b4054eb1b7fb72c5a0.tar.gz | |
Allow GIN's extractQuery method to signal that nothing can satisfy the query.
In this case extractQuery should returns -1 as nentries. This changes
prototype of extractQuery method to use int32* instead of uint32* for
nentries argument.
Based on that gincostestimate may see two corner cases: nothing will be found
or seqscan should be used.
Per proposal at http://archives.postgresql.org/pgsql-hackers/2007-01/msg01581.php
PS tsearch_core patch should be sightly modified to support changes, but I'm
waiting a verdict about reviewing of tsearch_core patch.
Diffstat (limited to 'src/include/access')
| -rw-r--r-- | src/include/access/gin.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/include/access/gin.h b/src/include/access/gin.h index c37b367278..80f2374996 100644 --- a/src/include/access/gin.h +++ b/src/include/access/gin.h @@ -3,7 +3,7 @@ * header file for postgres inverted index access method implementation. * * Copyright (c) 2006, PostgreSQL Global Development Group - * $PostgreSQL: pgsql/src/include/access/gin.h,v 1.9 2006/10/05 17:57:40 tgl Exp $ + * $PostgreSQL: pgsql/src/include/access/gin.h,v 1.10 2007/01/31 15:09:45 teodor Exp $ *-------------------------------------------------------------------------- */ @@ -233,8 +233,8 @@ extern void GinInitBuffer(Buffer b, uint32 f); extern void GinInitPage(Page page, uint32 f, Size pageSize); extern int compareEntries(GinState *ginstate, Datum a, Datum b); extern Datum *extractEntriesS(GinState *ginstate, Datum value, - uint32 *nentries, bool *needUnique); -extern Datum *extractEntriesSU(GinState *ginstate, Datum value, uint32 *nentries); + int32 *nentries, bool *needUnique); +extern Datum *extractEntriesSU(GinState *ginstate, Datum value, int32 *nentries); extern Page GinPageGetCopyPage(Page page); /* gininsert.c */ @@ -399,6 +399,8 @@ typedef struct GinScanOpaqueData GinScanKey keys; uint32 nkeys; + bool isVoidRes; /* true if ginstate.extractQueryFn + guarantees that nothing will be found */ GinScanKey markPos; } GinScanOpaqueData; @@ -458,7 +460,7 @@ typedef struct extern void ginInitBA(BuildAccumulator *accum); extern void ginInsertRecordBA(BuildAccumulator *accum, - ItemPointer heapptr, Datum *entries, uint32 nentry); + ItemPointer heapptr, Datum *entries, int32 nentry); extern ItemPointerData *ginGetEntry(BuildAccumulator *accum, Datum *entry, uint32 *n); #endif |
