explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ykDR

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 12,040.794 ↑ 5.9 17 1

Limit (cost=1,876,340.39..1,876,343.39 rows=100 width=71) (actual time=12,040.755..12,040.794 rows=17 loops=1)

2. 0.050 12,040.792 ↑ 30,231.2 17 1

GroupAggregate (cost=1,876,340.39..1,891,758.29 rows=513,930 width=71) (actual time=12,040.754..12,040.792 rows=17 loops=1)

  • Group Key: orders.o_totalprice, orders.o_orderdate, customer.c_name, customer.c_custkey, orders.o_orderkey
3. 0.172 12,040.742 ↑ 4,318.7 119 1

Sort (cost=1,876,340.39..1,877,625.21 rows=513,930 width=44) (actual time=12,040.737..12,040.742 rows=119 loops=1)

  • Sort Key: orders.o_totalprice DESC, orders.o_orderdate, customer.c_name, customer.c_custkey, orders.o_orderkey
  • Sort Method: quicksort Memory: 34kB
4. 2,131.746 12,040.570 ↑ 4,318.7 119 1

Hash Join (cost=1,298,451.77..1,811,781.51 rows=513,930 width=44) (actual time=8,459.08..12,040.57 rows=119 loops=1)

5. 1,684.820 1,684.820 ↑ 1.0 11,997,996 1

Seq Scan on lineitem lineitem (cost=0..344,899.96 rows=11,997,996 width=9) (actual time=0.005..1,684.82 rows=11,997,996 loops=1)

6. 0.089 8,224.004 ↑ 7,559.1 17 1

Hash (cost=1,295,715.47..1,295,715.47 rows=128,504 width=43) (actual time=8,224.003..8,224.004 rows=17 loops=1)

7. 14.299 8,223.915 ↑ 7,559.1 17 1

Hash Join (cost=1,164,963.52..1,295,715.47 rows=128,504 width=43) (actual time=7,361.293..8,223.915 rows=17 loops=1)

8. 601.411 8,116.701 ↑ 7,559.1 17 1

Hash Join (cost=1,149,286.52..1,275,007.54 rows=128,504 width=24) (actual time=7,197.458..8,116.701 rows=17 loops=1)

9. 417.339 417.339 ↑ 1.0 3,000,000 1

Seq Scan on orders orders (cost=0..82,186 rows=3,000,000 width=20) (actual time=0.008..417.339 rows=3,000,000 loops=1)

10. 0.108 7,097.951 ↑ 7,559.1 17 1

Hash (cost=1,147,178.22..1,147,178.22 rows=128,504 width=4) (actual time=7,097.951..7,097.951 rows=17 loops=1)

11. 2,295.637 7,097.843 ↑ 7,559.1 17 1

GroupAggregate (cost=1,003,020.16..1,145,893.18 rows=128,504 width=4) (actual time=3,057.48..7,097.843 rows=17 loops=1)

  • Group Key: lineitem_1.l_orderkey
  • Filter: (sum(lineitem_1.l_quantity) > '315'::numeric)
12. 548.104 4,802.206 ↓ 4.1 3,130,604 1

Gather Merge (cost=1,003,020.16..1,134,327.85 rows=771,022 width=36) (actual time=2,488.787..4,802.206 rows=3,130,604 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
13. 1,335.990 4,254.102 ↓ 2.7 1,043,535 3 / 3

GroupAggregate (cost=1,002,020.14..1,044,332.76 rows=385,511 width=36) (actual time=2,361.005..4,254.102 rows=1,043,535 loops=3)

  • Group Key: lineitem_1.l_orderkey
14. 2,195.350 2,918.112 ↑ 1.2 3,999,332 3 / 3

Sort (cost=1,002,020.14..1,014,518.05 rows=4,999,165 width=9) (actual time=2,360.98..2,918.112 rows=3,999,332 loops=3)

  • Sort Key: lineitem_1.l_orderkey
  • Sort Method: external merge Disk: 60,976kB
15. 722.762 722.762 ↑ 1.2 3,999,332 3 / 3

Seq Scan on lineitem lineitem_1 (cost=0..274,911.65 rows=4,999,165 width=9) (actual time=0.005..722.762 rows=3,999,332 loops=3)

16. 51.845 92.915 ↑ 1.0 300,000 1

Hash (cost=10,169..10,169 rows=300,000 width=23) (actual time=92.915..92.915 rows=300,000 loops=1)

17. 41.070 41.070 ↑ 1.0 300,000 1

Seq Scan on customer customer (cost=0..10,169 rows=300,000 width=23) (actual time=0.005..41.07 rows=300,000 loops=1)

Planning time : 0.403 ms
Execution time : 12,048.879 ms