Re: Assistance with optimizing query - same SQL, different category_id = Seq Scan

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: Assistance with optimizing query - same SQL, different category_id = Seq Scan
Дата
Msg-id 20060511220802.GU99570@pervasive.com
обсуждение исходный текст
Ответ на Assistance with optimizing query - same SQL, different category_id = Seq Scan  (Brendan Duddridge <brendan@clickspace.com>)
Список pgsql-performance
On Mon, May 08, 2006 at 07:29:32PM -0600, Brendan Duddridge wrote:
> Do you have any suggestions on how I can optimize the query so both
> versions of the query come back fast without doing a sequential scan
> on the price table?

Well, before you do anything you should verify that an index scan in the
second case would actually be faster. Set enable_seqscan=off and check
that.

After that, you can favor an index scan by (in order of effectiveness)
increasing the correlation on the appropriate index (by clustering on
it), lowering random_page_cost, or increasing effective_cache_size.
--
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 C. Nasby"
Дата:
Сообщение: Re: Dynamically loaded C function performance
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Big IN() clauses etc : feature proposal