=?iso-8859-1?q?Sebasti=E1n=20Baioni?= <sebaioni-postgresql@xxxxxxxxxxxx> writes: > 8 -> GroupAggregate (cost=0.00..37348395.05 rows=3951 width=25) (actual > time=130.000..2629617.000 rows=254576 loops=1) > 9 -> Index Scan using uesapt001 on APORTES (cost=0.00..37301678.64 > rows=9339331 width=25) (actual time=110.000..2520690.000 rows=9335892 loops=1) Given the relatively small estimated number of group rows, I'd have expected the thing to use a seqscan and HashAggregate for this part. Do you have enable_hashagg turned off for some reason? Or enable_seqscan? regards, tom lane