aligputf8=# explain analyze select sum(col1),sum(col2),sum(col3),sum(col4),sum(col5),sum(col6),sum(col7),sum(col8),sum(col9) from test_group group by col5; QUERY PLAN ---------------------------------------------------------------------------------------------------------- GroupAggregate (cost=10532.97..14755.93 rows=38336 width=62) Group By: col5 Rows out: 6401 rows with 306 ms to first row, 585 ms to end, start offset by 0.092 ms. Executor memory: 8K bytes. -> Sort (cost=10532.97..10803.61 rows=108256 width=62) Sort Key: col5 Rows out: 100000 rows with 306 ms to first row, 342 ms to end, start offset by 0.093 ms. Executor memory: 19449K bytes. Work_mem used: 19449K bytes. -> Seq Scan on test_group (cost=0.00..1480.56 rows=108256 width=62) Rows out: 100000 rows with 0.021 ms to first row, 46 ms to end, start offset by 0.116 ms. Slice statistics: (slice0) Executor memory: 19623K bytes. Work_mem: 19449K bytes max. Settings: enable_hashagg=off; enable_seqscan=off Total runtime: 586.114 ms (15 rows)