PostgreSQL 11: something for everyone
Oops, those included per-row timing overhead. Here&#x27;s the same without that:<p><pre><code>  postgres[24261][1]=# set jit = 1;
  
  postgres[24261][1]=# EXPLAIN (ANALYZE, TIMING OFF) SELECT min(tz), sum(data_double), max(data_double) FROM large WHERE tz &gt; &#x27;2018-09-23 14:47:30.298302-07&#x27;;
  ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
  │                                                         QUERY PLAN                                                          │
  ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ Finalize Aggregate  (cost=1495625.42..1495625.43 rows=1 width=24) (actual rows=1 loops=1)                                   │
  │   -&gt;  Gather  (cost=1495625.20..1495625.41 rows=2 width=24) (actual rows=3 loops=1)                                         │
  │         Workers Planned: 2                                                                                                  │
  │         Workers Launched: 2                                                                                                 │
  │         -&gt;  Partial Aggregate  (cost=1494625.20..1494625.21 rows=1 width=24) (actual rows=1 loops=3)                        │
  │               -&gt;  Parallel Seq Scan on large  (cost=0.00..1417317.00 rows=10307760 width=16) (actual rows=33333333 loops=3) │
  │                     Filter: (tz &gt; &#x27;2018-09-23 14:47:30.298302-07&#x27;::timestamp with time zone)                                │
  │ Planning Time: 0.121 ms                                                                                                     │
  │ JIT:                                                                                                                        │
  │   Functions: 8                                                                                                              │
  │   Inlining: true                                                                                                            │
  │   Optimization: true                                                                                                        │
  │ Execution Time: 2440.328 ms                                                                                                 │
  └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
  (13 rows)
  
  Time: 2440.891 ms (00:02.441)
  
  postgres[24261][1]=# set jit = 0;
  
  postgres[24261][1]=# EXPLAIN (ANALYZE, TIMING OFF) SELECT min(tz), sum(data_double), max(data_double) FROM large WHERE tz &gt; &#x27;2018-09-23 14:47:30.298302-07&#x27;;
  ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
  │                                                         QUERY PLAN                                                          │
  ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ Finalize Aggregate  (cost=1495625.42..1495625.43 rows=1 width=24) (actual rows=1 loops=1)                                   │
  │   -&gt;  Gather  (cost=1495625.20..1495625.41 rows=2 width=24) (actual rows=3 loops=1)                                         │
  │         Workers Planned: 2                                                                                                  │
  │         Workers Launched: 2                                                                                                 │
  │         -&gt;  Partial Aggregate  (cost=1494625.20..1494625.21 rows=1 width=24) (actual rows=1 loops=3)                        │
  │               -&gt;  Parallel Seq Scan on large  (cost=0.00..1417317.00 rows=10307760 width=16) (actual rows=33333333 loops=3) │
  │                     Filter: (tz &gt; &#x27;2018-09-23 14:47:30.298302-07&#x27;::timestamp with time zone)                                │
  │ Planning Time: 0.041 ms                                                                                                     │
  │ Execution Time: 4140.116 ms                                                                                                 │
  └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
  (9 rows)
  
  Time: 4140.499 ms (00:04.140)</code></pre>