From d4c6da152782b580b24cd8b4054eb1b7fb72c5a0 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Wed, 31 Jan 2007 15:09:45 +0000 Subject: 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. --- src/backend/access/gin/ginutil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/access/gin/ginutil.c') diff --git a/src/backend/access/gin/ginutil.c b/src/backend/access/gin/ginutil.c index a14900e56c6..e704e8051eb 100644 --- a/src/backend/access/gin/ginutil.c +++ b/src/backend/access/gin/ginutil.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/gin/ginutil.c,v 1.9 2007/01/05 22:19:21 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/gin/ginutil.c,v 1.10 2007/01/31 15:09:45 teodor Exp $ *------------------------------------------------------------------------- */ @@ -148,7 +148,7 @@ cmpEntries(const Datum *a, const Datum *b, cmpEntriesData *arg) } Datum * -extractEntriesS(GinState *ginstate, Datum value, uint32 *nentries, +extractEntriesS(GinState *ginstate, Datum value, int32 *nentries, bool *needUnique) { Datum *entries; @@ -178,7 +178,7 @@ extractEntriesS(GinState *ginstate, Datum value, uint32 *nentries, Datum * -extractEntriesSU(GinState *ginstate, Datum value, uint32 *nentries) +extractEntriesSU(GinState *ginstate, Datum value, int32 *nentries) { bool needUnique; Datum *entries = extractEntriesS(ginstate, value, nentries, -- cgit v1.2.3