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: Wed, 31 Jan 2007 19:19:50 +0300
- Message-id: <45C0C1A6(dot)3050807(at)sigaev(dot)ru>
(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/
Home |
Main Index |
Thread Index