Re: Query using SeqScan instead of IndexScan

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: Query using SeqScan instead of IndexScan
Дата
Msg-id B35559FB-1012-4C9A-811B-0F1D37462F34@pervasive.com
обсуждение исходный текст
Ответ на Re: Query using SeqScan instead of IndexScan  (Brendan Duddridge <brendan@clickspace.com>)
Список pgsql-performance
On Apr 1, 2006, at 12:51 PM, Brendan Duddridge wrote:
> from SELECT * FROM pg_stats WHERE tablename='table' AND
> attname='category_id'
>
> I find correlation on category_product for category_id is 0.643703
>
> Would setting the index on category_id to be clustered help with this?

It would absolutely help on the query in question. In my experience,
a correlation of 0.64 is too low to allow an index scan to be used
for anything but a tiny number of rows.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: Query using SeqScan instead of IndexScan
Следующее
От: "Mike Quinn"
Дата:
Сообщение: Re: The order of fields around the "=" in the WHERE