aligputf8=# set enable_hashagg = off; SET aligputf8=# explain select count(1) from pg_class group by oid; QUERY PLAN ---------------------------------------------------------------------------- GroupAggregate (cost=13291.66..14666.48 rows=23910 width=4) Group By: oid -> Sort (cost=13291.66..13650.31 rows=143460 width=4) Sort Key: oid -> Seq Scan on pg_class (cost=0.00..1004.10 rows=143460 width=4) Settings: enable_hashagg=off; enable_seqscan=on (6 rows)