load 'auto_explain'; LOAD set auto_explain.log_min_duration to 0; SET set auto_explain.log_analyze to on; SET set auto_explain.log_wal to on; SET set auto_explain.log_timing to on; SET set auto_explain.log_level to notice; SET BEGIN; BEGIN select l_returnflag, l_linestatus, sum(l_quantity) as sum_qty, sum(l_extendedprice) as sum_base_price, sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, avg(l_quantity) as avg_qty, avg(l_extendedprice) as avg_price, avg(l_discount) as avg_disc, count(*) as count_order from lineitem where l_shipdate <= date '1998-12-01' - interval '115 days' group by l_returnflag, l_linestatus order by l_returnflag, l_linestatus; NOTICE: duration: 59585.216 ms plan: Query Text: select l_returnflag, l_linestatus, sum(l_quantity) as sum_qty, sum(l_extendedprice) as sum_base_price, sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, avg(l_quantity) as avg_qty, avg(l_extendedprice) as avg_price, avg(l_discount) as avg_disc, count(*) as count_order from lineitem where l_shipdate <= date '1998-12-01' - interval '115 days' group by l_returnflag, l_linestatus order by l_returnflag, l_linestatus; Finalize GroupAggregate (cost=2331828.67..2331830.63 rows=6 width=236) (actual time=59580.391..59585.184 rows=4 loops=1) Group Key: l_returnflag, l_linestatus -> Gather Merge (cost=2331828.67..2331830.07 rows=12 width=236) (actual time=59580.320..59585.049 rows=12 loops=1) Workers Planned: 2 Workers Launched: 2 -> Sort (cost=2330828.65..2330828.66 rows=6 width=236) (actual time=59565.483..59565.485 rows=4 loops=3) Sort Key: l_returnflag, l_linestatus Sort Method: quicksort Memory: 27kB Worker 0: Sort Method: quicksort Memory: 27kB Worker 1: Sort Method: quicksort Memory: 27kB -> Partial HashAggregate (cost=2330828.43..2330828.57 rows=6 width=236) (actual time=59565.405..59565.424 rows=4 loops=3) Group Key: l_returnflag, l_linestatus Batches: 1 Memory Usage: 32kB Worker 0: Batches: 1 Memory Usage: 32kB Worker 1: Batches: 1 Memory Usage: 32kB -> Parallel Seq Scan on lineitem (cost=0.00..1473147.97 rows=24505156 width=25) (actual time=0.054..9481.579 rows=19537100 loops=3) Filter: (l_shipdate <= '1998-08-08 00:00:00'::timestamp without time zone) Rows Removed by Filter: 458161 l_returnflag | l_linestatus | sum_qty | sum_base_price | sum_disc_price | sum_charge | avg_qty | avg_price | avg_disc | count_order --------------+--------------+-----------+------------------+--------------------+----------------------+---------------------+--------------------+------------------------+------------- A | F | 377514630 | 566063237437.53 | 537756938342.3356 | 559274111139.186389 | 25.5007584070715760 | 38237.039610939705 | 0.05000600308496557193 | 14804055 N | F | 9853964 | 14770562128.73 | 14031586646.1636 | 14593357290.718851 | 25.5217261804553731 | 38255.695086855512 | 0.04998440822479092258 | 386101 N | O | 729560892 | 1093956850729.42 | 1039254941069.7861 | 1080837244422.514969 | 25.4976080556629760 | 38232.974540672280 | 0.04999913500599292313 | 28612915 R | F | 377734451 | 566440716493.13 | 538120091923.3004 | 559645084197.026832 | 25.5084167396666232 | 38251.755476288588 | 0.04999584150108979954 | 14808228 (4 rows) COMMIT; COMMIT