[fulltext]Gin index full scan

Lists: pgsql-general
From: esemba <esemba(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: [fulltext]Gin index full scan
Date: 2009-05-11 13:04:39
Message-ID: 23482754.post@talk.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general


I've a table with tsvector column named meta_vector. Over this column there
is a gin index. When I execute query like:
select id from theses where meta_vector @@@ to_tsquery('cs', 'foo | (!bar)')

I get an errror message: query requires full scan, which is not supported by
GIN indexes.

The weird thing is, that when I drop the index, or disable index scans, it
works. Why can't the planner just use full scans instead of index scans on
such the queries? Thanks for help.

Lukas
--
View this message in context: http://www.nabble.com/-fulltext-Gin-index-full-scan-tp23482754p23482754.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


From: Stuart Bishop <stuart(at)stuartbishop(dot)net>
To: esemba <esemba(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [fulltext]Gin index full scan
Date: 2009-05-18 05:21:35
Message-ID: 6bc73d4c0905172221s3b1b2a58yafbe19800f8b44b7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Mon, May 11, 2009 at 8:04 PM, esemba <esemba(at)gmail(dot)com> wrote:
>
> I've a table with tsvector column named meta_vector. Over this column there
> is a gin index. When I execute query like:
> select id from theses where meta_vector @@@ to_tsquery('cs', 'foo | (!bar)')
>
> I get an errror message: query requires full scan, which is not supported by
> GIN indexes.
>
> The weird thing is, that when I drop the index, or disable index scans, it
> works. Why can't the planner just use full scans instead of index scans on
> such the queries? Thanks for help.

You can search the archives for the last time this was brought up.
Apparently, it isn't an easy fix. People hoped to have it addressed
for 8.4 but I don't know if it made it. Unfortunately, this makes GIN
indexes unusable for many applications such as text searching using
arbitrary user queries. GIST indexes work, but perform worse for
reads.

--
Stuart Bishop <stuart(at)stuartbishop(dot)net>
http://www.stuartbishop.net/