Sample Header Ad - 728x90

PostgreSQL 8.3: Slow GROUP BY on large table

3 votes
2 answers
2020 views
I have a table with about 10 million records. I want to do a simple group by, but it's using a sequential scan and is slow... select run_id, count(*) from result group by run_id; I have an index defined on the run_id column. How can I speed this up?
Asked by FogleBird (131 rep)
Jan 28, 2013, 04:05 PM
Last activity: Feb 9, 2013, 08:34 AM