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. --- doc/src/sgml/gin.sgml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/gin.sgml b/doc/src/sgml/gin.sgml index c2bbad42bfa..32919e58711 100644 --- a/doc/src/sgml/gin.sgml +++ b/doc/src/sgml/gin.sgml @@ -1,4 +1,4 @@ - + GIN Indexes @@ -77,7 +77,7 @@ - Datum* extractValue(Datum inputValue, uint32 *nkeys) + Datum* extractValue(Datum inputValue, int32 *nkeys) Returns an array of keys given a value to be indexed. The @@ -87,7 +87,7 @@ - Datum* extractQuery(Datum query, uint32 *nkeys, + Datum* extractQuery(Datum query, int32 *nkeys, StrategyNumber n) @@ -100,6 +100,12 @@ to consult n to determine the data type of query and the key values that need to be extracted. The number of returned keys must be stored into *nkeys. + If number of keys is equal to zero then extractQuery + should store 0 or -1 into *nkeys. 0 means that any + row matches the query and sequence scan should be + produced. -1 means nothing can satisfy query. + Choice of value should be based on semantics meaning of operation with + given strategy number. -- cgit v1.2.3