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

Lists: pgsql-general
From: Stuart Bishop <stuart(at)stuartbishop(dot)net>
To: PgSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Regression - Query requires full scan, GIN doesn't support it
Date: 2007-06-19 05:25:53
Message-ID: 467768E1.3040704@stuartbishop.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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(at)stuartbishop(dot)net>
http://www.stuartbishop.net/


From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Stuart Bishop <stuart(at)stuartbishop(dot)net>
Cc: PgSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Regression - Query requires full scan, GIN doesn't support it
Date: 2007-06-22 09:18:53
Message-ID: 467B93FD.9060508@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

> 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(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/