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=3938.695..3938.729 rows=101 loops=1)
   ->  Seq Scan on t_int4_r100  (cost=0.00..72124.00 rows=5000000 width=4) (actual time=18.867..1259.864 rows=5000000 loops=1)
 Total runtime: 3938.877 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=6068.345..6665.294 rows=993261 loops=1)
   ->  Seq Scan on t_int4_r1000000  (cost=0.00..72124.00 rows=5000000 width=4) (actual time=8.059..1594.859 rows=5000000 loops=1)
 Total runtime: 6810.390 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=3761.053..3761.097 rows=100 loops=1)
   ->  Seq Scan on t_int4_s100  (cost=0.00..72124.00 rows=5000000 width=4) (actual time=9.154..1221.342 rows=5000000 loops=1)
 Total runtime: 3761.160 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=4297.653..4865.285 rows=1000000 loops=1)
   ->  Seq Scan on t_int4_s1000000  (cost=0.00..72124.00 rows=5000000 width=4) (actual time=0.370..1312.563 rows=5000000 loops=1)
 Total runtime: 5007.536 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.922..4349.956 rows=101 loops=1)
   ->  Seq Scan on t_int8_r100  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=14.628..1597.474 rows=5000000 loops=1)
 Total runtime: 4350.044 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=6132.590..6690.615 rows=993234 loops=1)
   ->  Seq Scan on t_int8_r1000000  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=16.930..1631.853 rows=5000000 loops=1)
 Total runtime: 6831.889 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=3806.842..3806.883 rows=100 loops=1)
   ->  Seq Scan on t_int8_s100  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=6.518..1226.866 rows=5000000 loops=1)
 Total runtime: 3806.947 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=4478.166..5053.958 rows=1000000 loops=1)
   ->  Seq Scan on t_int8_s1000000  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=7.475..1447.445 rows=5000000 loops=1)
 Total runtime: 5199.870 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=4218.434..4218.469 rows=101 loops=1)
   ->  Seq Scan on t_float8_r100  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=15.059..1260.792 rows=5000000 loops=1)
 Total runtime: 4218.554 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=6132.765..6720.070 rows=993323 loops=1)
   ->  Seq Scan on t_float8_r1000000  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=18.672..1364.943 rows=5000000 loops=1)
 Total runtime: 6862.112 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=4164.106..4164.152 rows=100 loops=1)
   ->  Seq Scan on t_float8_s100  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=3.271..1293.212 rows=5000000 loops=1)
 Total runtime: 4164.214 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=4665.948..5251.064 rows=1000000 loops=1)
   ->  Seq Scan on t_float8_s1000000  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=8.500..1368.732 rows=5000000 loops=1)
 Total runtime: 5393.817 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=4740.635..4740.673 rows=101 loops=1)
   ->  Seq Scan on t_text_r100  (cost=0.00..77028.00 rows=5000000 width=9) (actual time=15.707..1508.789 rows=5000000 loops=1)
 Total runtime: 4740.757 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=6771.557..7353.790 rows=993263 loops=1)
   ->  Seq Scan on t_text_r1000000  (cost=0.00..77028.00 rows=5000000 width=13) (actual time=15.174..1465.975 rows=5000000 loops=1)
 Total runtime: 7498.037 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=4526.013..4526.055 rows=100 loops=1)
   ->  Seq Scan on t_text_s100  (cost=0.00..77028.00 rows=5000000 width=9) (actual time=7.506..1368.075 rows=5000000 loops=1)
 Total runtime: 4526.120 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=5103.223..5674.066 rows=1000000 loops=1)
   ->  Seq Scan on t_text_s1000000  (cost=0.00..77028.00 rows=5000000 width=13) (actual time=7.782..1429.473 rows=5000000 loops=1)
 Total runtime: 5816.298 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=7079.947..7079.983 rows=101 loops=1)
   ->  Seq Scan on t_numeric_r100  (cost=0.00..72124.00 rows=5000000 width=6) (actual time=23.826..1233.736 rows=5000000 loops=1)
 Total runtime: 7080.073 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=8771.778..9348.156 rows=993355 loops=1)
   ->  Seq Scan on t_numeric_r1000000  (cost=0.00..76945.00 rows=5000000 width=8) (actual time=4.993..1273.364 rows=5000000 loops=1)
 Total runtime: 9491.562 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=7213.715..7213.753 rows=100 loops=1)
   ->  Seq Scan on t_numeric_s100  (cost=0.00..72124.00 rows=5000000 width=7) (actual time=8.212..1365.157 rows=5000000 loops=1)
 Total runtime: 7213.822 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=7189.496..7788.642 rows=1000000 loops=1)
   ->  Seq Scan on t_numeric_s1000000  (cost=0.00..76978.00 rows=5000000 width=8) (actual time=12.538..1283.205 rows=5000000 loops=1)
 Total runtime: 7932.716 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=4019.925..4019.968 rows=100 loops=1)
   ->  Seq Scan on t_timestamp_s100  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=9.143..1343.103 rows=5000000 loops=1)
 Total runtime: 4020.059 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=4187.461..4806.027 rows=1000000 loops=1)
   ->  Seq Scan on t_timestamp_s1000000  (cost=0.00..72124.00 rows=5000000 width=8) (actual time=4.491..1238.042 rows=5000000 loops=1)
 Total runtime: 4966.655 ms
(3 rows)

