| От | tsuraan |
|---|---|
| Тема | Re: group by will not use an index? |
| Дата | |
| Msg-id | 84fb38e30701100914y63010d26n8401d74729d12380@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: group by will not use an index? (Andrew Lazarus <andrew@pillette.com>) |
| Список | pgsql-performance |
For the reasons indicated (that is, MVCC), PG can not do a DISTINCT or the equivalent
GROUP BY from index values alone.
If this table is large, perhaps you could denormalize and maintain a
summary table with date (using truncation) and count, updated with
triggers on the original table. This table will presumably have a
small number of rows at the cost of doubling the times for updates,
inserts, and deletes.
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера