Re: pgsql: Allow GIN's extractQuery method to signal that nothing can

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Allow GIN's extractQuery method to signal that nothing can
Date: 2007-01-31 16:19:50
Message-ID: 45C0C1A6.3050807@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2007-01-31 16:37:53 Re: pgsql: Allow GIN's extractQuery method to signal that nothing can
Previous Message Tom Lane 2007-01-31 15:40:15 Re: pgsql: Allow GIN's extractQuery method to signal that nothing can