Re: sequential scan unduly favored over text search gin index

Поиск
Список
Период
Сортировка
От Jesper Krogh
Тема Re: sequential scan unduly favored over text search gin index
Дата
Msg-id 4DFF9872.6030104@krogh.cc
обсуждение исходный текст
Ответ на sequential scan unduly favored over text search gin index  (Sushant Sinha <sushant354@gmail.com>)
Список pgsql-performance
On 2011-06-20 17:38, Sushant Sinha wrote:
> I have a tsvector column docvector and a gin index on it
> docmeta1_docvector_idx
>
> I have a simple query "select * from docmeta1 where docvector @@
> plainto_tsquery('english', 'free');"
>
> I find that the planner chooses a sequential scan of the table even when
> the index performs orders of magnitude. I set random_page_cost = 1.0 for
> the database to favor index use. However, I still see that the cost
> estimate for sequential scan of the entire table (23000) is cheaper than
> the cost of using the index (33000). The time taken for sequential
> access is 5200 ms and for index usage is only 85 ms.
The cost-estimation code for gin-indices are not good in 9.0, this has
hugely been improved in 9.1

http://git.postgresql.org/gitweb?p=postgresql.git&a=search&h=HEAD&st=commit&s=gincost

I think the individual patches apply quite cleanly to 9.0 as far
as I remember.

--
Jesper

В списке pgsql-performance по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: bad plan: 8.4.8, hashagg, work_mem=1MB.
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: sequential scan unduly favored over text search gin index