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 '99 days' group by l_returnflag, l_linestatus order by l_returnflag, l_linestatus; NOTICE: duration: 31483.428 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 '99 days' group by l_returnflag, l_linestatus order by l_returnflag, l_linestatus; Finalize GroupAggregate (cost=2329897.73..2329899.69 rows=6 width=236) (actual time=31482.057..31483.410 rows=4 loops=1) Group Key: l_returnflag, l_linestatus -> Gather Merge (cost=2329897.73..2329899.13 rows=12 width=236) (actual time=31482.020..31483.339 rows=12 loops=1) Workers Planned: 2 Workers Launched: 2 -> Sort (cost=2328897.71..2328897.72 rows=6 width=236) (actual time=31479.523..31479.525 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=2328897.49..2328897.63 rows=6 width=236) (actual time=31479.483..31479.495 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..1468753.24 rows=24575550 width=25) (actual time=0.018..4406.472 rows=19675034 loops=3) Filter: (l_shipdate <= '1998-08-24 00:00:00'::timestamp without time zone) Rows Removed by Filter: 340189 l_returnflag | l_linestatus | sum_qty | sum_base_price | sum_disc_price | sum_charge | avg_qty | avg_price | avg_disc | count_order --------------+--------------+-----------+------------------+--------------------+----------------------+---------------------+--------------------+------------------------+------------- A | F | 377894559 | 566631033415.69 | 538296159335.2375 | 559835119512.776241 | 25.5010315616080795 | 38237.321821085318 | 0.05000625084563218534 | 14818795 N | F | 9861178 | 14781737358.83 | 14042329814.3886 | 14604572533.962013 | 25.5213074872538109 | 38256.003930821191 | 0.04997611221822510935 | 386390 N | O | 739358904 | 1108654774480.24 | 1053217432840.3144 | 1095358993531.690674 | 25.4978391501112325 | 38233.530373091987 | 0.04999928061335057470 | 28996924 R | F | 378111888 | 567001399027.56 | 538652791476.4533 | 560198413015.669207 | 25.5084727833624952 | 38251.481146826498 | 0.04999665047380447888 | 14822992 (4 rows) COMMIT; COMMIT