| От | Tom Lane |
|---|---|
| Тема | Re: Aggregate View and Conditions taking FOREVER |
| Дата | |
| Msg-id | 27634.1192377528@sss.pgh.pa.us обсуждение |
| Ответ на | Aggregate View and Conditions taking FOREVER (illusina <illusina@hotmail.com>) |
| Список | pgsql-general |
illusina <illusina@hotmail.com> writes:
> Ok..I've got a view which returns agency_id, fiscal_year, reporting_month,
> count_col0, count_col1...grouping by agency_id, fiscal_year and
> reporting_month. Now, if I just select * from myreport; it returns all the
> various counts for the various fiscal years and all that within 4 seconds,
> but if I add a conditional ie where fiscal_year = 2006 and reporting_month =
> 11, the query takes...10 minutes -- which I think is because the conditional
> cols (ie fiscal_year) is calculated via extract(year from datecol) which I
> think is causing that function to be checked on every row within the view.
Rather than guessing, how about showing EXPLAIN ANALYZE output for both
cases?
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера