| От | Dobes Vandermeer |
|---|---|
| Тема | Optimizing sum() operations |
| Дата | |
| Msg-id | 7324d9a20810030151n2341c5dcide9681bf74daa4cc@mail.gmail.com обсуждение |
| Ответы |
Re: Optimizing sum() operations
|
| Список | pgsql-novice |
I'm currently using sum() to compute historical values in reports; basically select sum(amount) on records where date <= '...' and date >= '...' who = X. Of course, I have an index on the table for who and date, but that still leaves potentially thousands of rows to scan. First, should I be worried about the performance of this, or will postgres sum a few thousand rows in a few milliseconds on a decent system anyway? Second, if this is a concern, is there a best practice for optimizing these kinds of queries? Any help or advice appreciated!
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера