Re: pgsql: Allow GIN's extractQuery method to signal that nothing can - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Allow GIN's extractQuery method to signal that nothing can
Date
Msg-id 26326.1170258015@sss.pgh.pa.us
Whole thread Raw
In response to pgsql: Allow GIN's extractQuery method to signal that nothing can  (teodor@postgresql.org (Teodor Sigaev))
Responses Re: pgsql: Allow GIN's extractQuery method to signal that nothing can  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-committers
teodor@postgresql.org (Teodor Sigaev) writes:
> Log Message:
> -----------
> 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.

This patch contains some pretty ugly coding in gincostestimate that
thinks it must go out of its way to prevent full indexscans.  But
(a) it does not work (you cannot positively guarantee a plan will not
be chosen just by setting its cost high) and (b) it is unnecessary.
pg_am.amoptionalkey = false is the right way, and you already have that.
So please remove the klugery in gincostestimate.

            regards, tom lane

pgsql-committers by date:

Previous
From: teodor@postgresql.org (Teodor Sigaev)
Date:
Subject: pgsql: Update FreeBSD DocBook installation notices
Next
From: Teodor Sigaev
Date:
Subject: Re: pgsql: Allow GIN's extractQuery method to signal that nothing can