Re: Slow query performance on large table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Slow query performance on large table
Дата
Msg-id 27569.1046800393@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Slow query performance on large table  (Andreas Pflug <Andreas.Pflug@web.de>)
Список pgsql-performance
Andreas Pflug <Andreas.Pflug@web.de> writes:
> "create index ind_meas on measurement (assessment,time)"  should perform
> the same as "... primary key(assessment,time)".

Sure.

> Do possibly non-optimal indices (only assessment, only time as Paul
> described earlier) screw up the optimizer, igoring the better option
> usiing the PK?

One would like to think the optimizer will make the right choice.  But
using a two-column index just because it's there isn't necessarily the
right choice.  The two-column index will certainly be bulkier and more
expensive to scan, so if there's a one-column index that's nearly as
selective, it might be a better choice.

            regards, tom lane

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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: PostgreSQL Performance Issue on Mail Server
Следующее
От: Andreas Pflug
Дата:
Сообщение: Re: Slow query performance on large table