Re: Query tuning: partitioning, DISTINCT ON, and indexing

Поиск
Список
Период
Сортировка
От Maciek Sakrejda
Тема Re: Query tuning: partitioning, DISTINCT ON, and indexing
Дата
Msg-id CAOtHd0DufFT1RqnL4fbCG_iPjRa0VdJHDSDp36EQ6wcXhd4ANA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Query tuning: partitioning, DISTINCT ON, and indexing  (bricklen <bricklen@gmail.com>)
Список pgsql-performance
On Fri, Jun 21, 2013 at 9:08 AM, bricklen <bricklen@gmail.com> wrote:
Did you try an index on (type, ts desc) ? I don't have much else to add at this point, but maybe after posting some more server and table (parent and child) details someone will have an answer for you.

No, this is exactly what I was missing. I had forgotten the default index order is useless for a descending lookup like this: I made the change and the performance is 3000x better (the plan's using the index now). Thanks for all your help.

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

Предыдущее
От: bricklen
Дата:
Сообщение: Re: Query tuning: partitioning, DISTINCT ON, and indexing
Следующее
От: Josh Berkus
Дата:
Сообщение: Weird, bad 0.5% selectivity estimate for a column equal to itself