| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера