Yet another optimizer index choosing questions

Поиск
Список
Период
Сортировка
От Elein
Тема Yet another optimizer index choosing questions
Дата
Msg-id 3C50A6DD.4090504@nextbus.com
обсуждение исходный текст
Ответы Re: Yet another optimizer index choosing questions  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Yet another optimizer index choosing questions  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
I have a four part primary key and only qualify
the query on the table against the first part of
the primary key.

When I do the query, it never uses the primary key
index.

Does postgres use partial indexes at all?
If so, the distribution of this one part of a primary
key is very even.  That is, each bucket has a
similar count.

I created a separate index on the first part of
the primary key and the query used it and cut down
the cost of the query significantly.

The table has about 50K rows but the
original query eats enough memory to choke postgres
(yes, yes, I'll throw more memory at it, too).
The query using the additional index works well.

Why did I have to create a second index?  Why
didn't it use a partial of the primary key index?

thanks,
elein

--
--------------------------------------------------------
elein@nextbus.com
(510)420-3120
www.nextbus.com
    spinning to infinity, hallelujah
--------------------------------------------------------


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Simple 'type' question
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Yet another optimizer index choosing questions