yes, it doesn't look good. and it seems that statistics aren't accurate: GroupAggregate (cost=271794.39..330553.67 rows=215630 width=152) (actual time=30.641..37.303 rows=2792 loops=1) -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html