Re: slow group by query
От | Tom Lane |
---|---|
Тема | Re: slow group by query |
Дата | |
Msg-id | 20977.1037719286@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | slow group by query (Ellen Cyran <ellen@urban.csuohio.edu>) |
Ответы |
Re: slow group by query
|
Список | pgsql-sql |
Ellen Cyran <ellen@urban.csuohio.edu> writes: > Is there any way to make this query faster? I have indexes on year, > msa_code, and sic. I've also tried it with > an index on the combined group by columns. I've made both sort_mem and > shared_buffers bigger, but still this query > takes 40 seconds when I select 4 msa_codes and 7 minutes when I select 40 > msa_codes. Hm, have you vacuum analyzed lately? Those cost estimates seem awfully low for a query that is taking 40 sec. Also, if you're using 7.2 (which you should be ;-)) then showing EXPLAIN ANALYZE results would be more useful than plain EXPLAIN. regards, tom lane
В списке pgsql-sql по дате отправления: