On Tue, 2005-08-02 at 13:05, Dr NoName wrote: > siam_production=> explain analyze select * from render > where person_id = 432; > > QUERY PLAN > -------------------------------------------------------------------------------------------------------------- > Seq Scan on render (cost=0.00..39014.72 rows=27833 > width=1493) (actual time=7.11..743.55 rows=5261 > loops=1) > Filter: (person_id = 432) > Total runtime: 747.42 msec > (3 rows) Notice the disparity here? The query planner thinks that there's gonna be 27833 rows returned, but there's only really 5261 being returned. When's the last time you analyzed this table? And have you considered running the pg_autovacuum daemon, which will vacuum and analyze for you in the back ground? ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend