set enable_sort = f;
SET
set work_mem = '256MB';
SET
explain analyze select i, count(*) from t_int4_r100 group by i;
                                                          QUERY PLAN                                                           
-------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..97125.26 rows=101 width=4) (actual time=4215.518..4215.554 rows=101 loops=1)
   ->  Seq Scan on t_int4_r100  (cost=0.00..72124.00 rows=5000000 width=4) (actual time=15.575..1593.135 rows=5000000 loops=1)
 Total runtime: 4215.703 ms
(3 rows)

explain analyze select i, count(*) from t_int4_r1000000 group by i;
                                                            QUERY PLAN                                                             
-----------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..107714.45 rows=847236 width=4) (actual time=6086.528..6689.008 rows=993261 loops=1)
   ->  Seq Scan on t_int4_r1000000  (cost=0.00..72124.00 rows=5000000 width=4) (actual time=17.881..1580.432 rows=5000000 loops=1)
 Total runtime: 6849.217 ms
(3 rows)

explain analyze select i, count(*) from t_int4_s100 group by i;
                                                          QUERY PLAN                                                          
------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..97125.25 rows=100 width=4) (actual time=3687.010..3687.052 rows=100 loops=1)
   ->  Seq Scan on t_int4_s100  (cost=0.00..72124.00 rows=5000000 width=4) (actual time=0.037..1199.359 rows=5000000 loops=1)
 Total runtime: 3687.116 ms
(3 rows)

explain analyze select i, count(*) from t_int4_s1000000 group by i;
                                                            QUERY PLAN                                                            
----------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..109660.02 rows=1002882 width=4) (actual time=4350.559..4925.920 rows=1000000 loops=1)
   ->  Seq Scan on t_int4_s1000000  (cost=0.00..72124.00 rows=5000000 width=4) (actual time=0.080..1309.719 rows=5000000 loops=1)
 Total runtime: 5065.944 ms
(3 rows)

explain analyze select i, count(*) from t_int8_r100 group by i;
                                                          QUERY PLAN                                                           
-------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..97125.26 rows=101 width=8) (actual time=4349.648..4349.684 rows=101 loops=1)
   ->  Seq Scan on t_int8_r100  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=47.040..1713.759 rows=5000000 loops=1)
 Total runtime: 4349.768 ms
(3 rows)

explain analyze select i, count(*) from t_int8_r1000000 group by i;
                                                            QUERY PLAN                                                             
-----------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..107673.66 rows=843973 width=8) (actual time=6134.456..6735.564 rows=993234 loops=1)
   ->  Seq Scan on t_int8_r1000000  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=20.009..1682.586 rows=5000000 loops=1)
 Total runtime: 6879.214 ms
(3 rows)

explain analyze select i, count(*) from t_int8_s100 group by i;
                                                          QUERY PLAN                                                           
-------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..97125.25 rows=100 width=8) (actual time=3738.924..3738.959 rows=100 loops=1)
   ->  Seq Scan on t_int8_s100  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=12.190..1210.215 rows=5000000 loops=1)
 Total runtime: 3739.030 ms
(3 rows)

explain analyze select i, count(*) from t_int8_s1000000 group by i;
                                                            QUERY PLAN                                                            
----------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..109381.43 rows=980594 width=8) (actual time=4300.906..4883.596 rows=1000000 loops=1)
   ->  Seq Scan on t_int8_s1000000  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=7.905..1306.069 rows=5000000 loops=1)
 Total runtime: 5026.977 ms
(3 rows)

explain analyze select f, count(*) from t_float8_r100 group by f;
                                                           QUERY PLAN                                                            
---------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..97125.26 rows=101 width=8) (actual time=4873.566..4873.602 rows=101 loops=1)
   ->  Seq Scan on t_float8_r100  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=28.302..2059.094 rows=5000000 loops=1)
 Total runtime: 4873.688 ms
(3 rows)

explain analyze select f, count(*) from t_float8_r1000000 group by f;
                                                             QUERY PLAN                                                              
-------------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..107563.25 rows=835140 width=8) (actual time=5973.353..6531.629 rows=993323 loops=1)
   ->  Seq Scan on t_float8_r1000000  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=18.477..1351.767 rows=5000000 loops=1)
 Total runtime: 6671.773 ms
(3 rows)

explain analyze select f, count(*) from t_float8_s100 group by f;
                                                           QUERY PLAN                                                           
--------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..97125.25 rows=100 width=8) (actual time=4172.268..4172.312 rows=100 loops=1)
   ->  Seq Scan on t_float8_s100  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=9.813..1401.139 rows=5000000 loops=1)
 Total runtime: 4172.375 ms
(3 rows)

explain analyze select f, count(*) from t_float8_s1000000 group by f;
                                                             QUERY PLAN                                                             
------------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..110179.88 rows=1044470 width=8) (actual time=4456.326..5041.142 rows=1000000 loops=1)
   ->  Seq Scan on t_float8_s1000000  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=8.230..1269.930 rows=5000000 loops=1)
 Total runtime: 5182.600 ms
(3 rows)

explain analyze select t, count(*) from t_text_r100 group by t;
                                                          QUERY PLAN                                                          
------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=102028.00..102029.26 rows=101 width=9) (actual time=4679.523..4679.561 rows=101 loops=1)
   ->  Seq Scan on t_text_r100  (cost=0.00..77028.00 rows=5000000 width=9) (actual time=8.796..1472.892 rows=5000000 loops=1)
 Total runtime: 4679.643 ms
(3 rows)

explain analyze select t, count(*) from t_text_r1000000 group by t;
                                                             QUERY PLAN                                                             
------------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=102028.00..112806.26 rows=862261 width=13) (actual time=6604.767..7190.341 rows=993263 loops=1)
   ->  Seq Scan on t_text_r1000000  (cost=0.00..77028.00 rows=5000000 width=13) (actual time=19.150..1440.438 rows=5000000 loops=1)
 Total runtime: 7334.535 ms
(3 rows)

explain analyze select t, count(*) from t_text_s100 group by t;
                                                          QUERY PLAN                                                          
------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=102028.00..102029.25 rows=100 width=9) (actual time=4412.373..4412.416 rows=100 loops=1)
   ->  Seq Scan on t_text_s100  (cost=0.00..77028.00 rows=5000000 width=9) (actual time=8.672..1331.256 rows=5000000 loops=1)
 Total runtime: 4412.481 ms
(3 rows)

explain analyze select t, count(*) from t_text_s1000000 group by t;
                                                            QUERY PLAN                                                             
-----------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=102028.00..114231.08 rows=976246 width=13) (actual time=4999.024..5581.776 rows=1000000 loops=1)
   ->  Seq Scan on t_text_s1000000  (cost=0.00..77028.00 rows=5000000 width=13) (actual time=6.154..1441.164 rows=5000000 loops=1)
 Total runtime: 5725.428 ms
(3 rows)

explain analyze select n, count(*) from t_numeric_r100 group by n;
                                                            QUERY PLAN                                                            
----------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..97125.26 rows=101 width=6) (actual time=7221.880..7221.916 rows=101 loops=1)
   ->  Seq Scan on t_numeric_r100  (cost=0.00..72124.00 rows=5000000 width=6) (actual time=21.306..1365.117 rows=5000000 loops=1)
 Total runtime: 7222.056 ms
(3 rows)

explain analyze select n, count(*) from t_numeric_r1000000 group by n;
                                                              QUERY PLAN                                                              
--------------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=101945.00..111908.99 rows=797119 width=8) (actual time=8617.883..9186.592 rows=993355 loops=1)
   ->  Seq Scan on t_numeric_r1000000  (cost=0.00..76945.00 rows=5000000 width=8) (actual time=10.525..1306.728 rows=5000000 loops=1)
 Total runtime: 9328.563 ms
(3 rows)

explain analyze select n, count(*) from t_numeric_s100 group by n;
                                                            QUERY PLAN                                                            
----------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..97125.25 rows=100 width=7) (actual time=7229.507..7229.550 rows=100 loops=1)
   ->  Seq Scan on t_numeric_s100  (cost=0.00..72124.00 rows=5000000 width=7) (actual time=26.620..1484.239 rows=5000000 loops=1)
 Total runtime: 7229.614 ms
(3 rows)

explain analyze select n, count(*) from t_numeric_s1000000 group by n;
                                                             QUERY PLAN                                                              
-------------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=101978.00..114514.02 rows=1002882 width=8) (actual time=7216.698..7819.454 rows=1000000 loops=1)
   ->  Seq Scan on t_numeric_s1000000  (cost=0.00..76978.00 rows=5000000 width=8) (actual time=6.441..1303.645 rows=5000000 loops=1)
 Total runtime: 7969.369 ms
(3 rows)

explain analyze select ts, count(*) from t_timestamp_s100 group by ts;
                                                            QUERY PLAN                                                             
-----------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..97125.25 rows=100 width=8) (actual time=3931.436..3931.477 rows=100 loops=1)
   ->  Seq Scan on t_timestamp_s100  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=8.517..1335.479 rows=5000000 loops=1)
 Total runtime: 3931.563 ms
(3 rows)

explain analyze select ts, count(*) from t_timestamp_s1000000 group by ts;
                                                              QUERY PLAN                                                               
---------------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=97124.00..110528.35 rows=1072348 width=8) (actual time=4199.054..4781.376 rows=1000000 loops=1)
   ->  Seq Scan on t_timestamp_s1000000  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=6.742..1259.970 rows=5000000 loops=1)
 Total runtime: 4944.081 ms
(3 rows)

