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

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

 From docs:
 >>>>>
When amcanmulticol is false, amoptionalkey essentially says whether the access
method allows full-index scans without any restriction clause.
<<<<<

amcanmulticol doesn't resolve issue, because restriction clause might present,
but it might have not any actual values ( void tsquery, void array ) and
semantic meaning of void query might be a 'any tuple matches'. Suggested
gincostestimation's patch allows to prevent from index in some situations, I
imagine, that isn't a good solution for two reason:
  - high cost doesn't guarantee an indexscan will be choosen
  - Doesn't work with anything except Const query
But I didn't  find a better place to insert it to resolve first point.

Sorry, but now I have no idea how to produce GIN's fullindex scan without
disaster performance gap. If you insist then I'll remove whole new code in
gincostestimate...


--
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Allow GIN's extractQuery method to signal that nothing can
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Allow GIN's extractQuery method to signal that nothing can