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 '107 days' group by l_returnflag, l_linestatus order by l_returnflag, l_linestatus; NOTICE: duration: 61166.125 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 '107 days' group by l_returnflag, l_linestatus order by l_returnflag, l_linestatus; Finalize GroupAggregate (cost=2334572.50..2334574.45 rows=6 width=236) (actual time=61164.501..61166.106 rows=4 loops=1) Group Key: l_returnflag, l_linestatus -> Gather Merge (cost=2334572.50..2334573.90 rows=12 width=236) (actual time=61164.456..61166.021 rows=12 loops=1) Workers Planned: 2 Workers Launched: 2 -> Sort (cost=2333572.47..2333572.49 rows=6 width=236) (actual time=61161.600..61161.602 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=2333572.26..2333572.39 rows=6 width=236) (actual time=61161.559..61161.572 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=24583551 width=25) (actual time=0.015..8901.792 rows=19598480 loops=3) Filter: (l_shipdate <= '1998-08-16 00:00:00'::timestamp without time zone) Rows Removed by Filter: 396780 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 | 734253749 | 1100997683266.44 | 1045944844659.0304 | 1087794634321.370499 | 25.4975273688557827 | 38232.993158517553 | 0.04999825225195755247 | 28797057 R | F | 377734451 | 566440716493.13 | 538120091923.3004 | 559645084197.026832 | 25.5084167396666232 | 38251.755476288588 | 0.04999584150108979954 | 14808228 (4 rows) COMMIT; COMMIT