Обсуждение: Regression - Query requires full scan, GIN doesn't support it

Поиск
Список
Период
Сортировка

Regression - Query requires full scan, GIN doesn't support it

От
Stuart Bishop
Дата:
Hi.

I recently converted a load of GIST indexes used by tsearch2 to GIN, as my
app is read heavy. We now occasionally get the exception:

    Query requires full scan, GIN doesn't support it

Thankfully it is happening very rarely, but as the querys are generated from
user input we can't stop this entirely.

Is this a permanent limitation of GIN, or is a fix possible?

Is a fix being worked on?

If a fix is forthcoming, will it be available in the 8.2 series or only 8.3+?

(It certainly looks like a bug to me, as the relevant queries work if the
index is dropped, and queries working or failing depending on the existence
of an index seems rather wrong to me.)

Only relevant discussion on this I can find is
http://archives.postgresql.org/pgsql-hackers/2007-01/msg01581.php. There
appear to be no replies visible though :-(

--
Stuart Bishop <stuart@stuartbishop.net>
http://www.stuartbishop.net/


Вложения

Re: Regression - Query requires full scan, GIN doesn't support it

От
Teodor Sigaev
Дата:
> Is this a permanent limitation of GIN, or is a fix possible?
Permanent. You could check user input by querytree() function --- if it returns
'T' string then fullscan will be needed. If your tsquery is produced by
plainto_tsquery() call then it will not find any result, so you can show to user
void page.

> Is a fix being worked on?
> If a fix is forthcoming, will it be available in the 8.2 series or only 8.3+?

Possibly, full fix in 8.4. But I will not promise.
8.3 will have protection from queries which doesn't match anything.

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