explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZgcH

Settings
# exclusive inclusive rows x rows loops node
1. 16.441 1,670.174 ↑ 1.0 20 1

Limit (cost=403,632.46..403,632.51 rows=20 width=201) (actual time=1,653.733..1,670.174 rows=20 loops=1)

2. 24.136 1,653.733 ↑ 5,732.4 20 1

Sort (cost=403,632.46..403,919.08 rows=114,647 width=201) (actual time=1,653.731..1,653.733 rows=20 loops=1)

  • Sort Key: (sum((lineitem.l_extendedprice * ('1'::numeric - lineitem.l_discount)))) DESC
  • Sort Method: top-N heapsort Memory: 34kB
3. 49.040 1,629.597 ↑ 1.5 74,259 1

GroupAggregate (cost=384,060.52..400,581.75 rows=114,647 width=201) (actual time=1,442.594..1,629.597 rows=74,259 loops=1)

  • Group Key: customer.c_custkey, customer.c_name, customer.c_acctbal, customer.c_phone, nation.n_name, customer.c_address, customer.c_comment
4. 58.530 1,580.557 ↑ 1.3 74,259 1

Gather Merge (cost=384,060.52..396,999.01 rows=95,540 width=201) (actual time=1,442.58..1,580.557 rows=74,259 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 67.437 1,522.027 ↑ 1.9 24,753 3 / 3

GroupAggregate (cost=383,060.5..384,971.3 rows=47,770 width=201) (actual time=1,438.786..1,522.027 rows=24,753 loops=3)

  • Group Key: customer.c_custkey, customer.c_name, customer.c_acctbal, customer.c_phone, nation.n_name, customer.c_address, customer.c_comment
6. 149.162 1,454.590 ↓ 1.6 74,102 3 / 3

Sort (cost=383,060.5..383,179.93 rows=47,770 width=181) (actual time=1,438.767..1,454.59 rows=74,102 loops=3)

  • Sort Key: customer.c_custkey, customer.c_name, customer.c_acctbal, customer.c_phone, nation.n_name, customer.c_address, customer.c_comment
  • Sort Method: external merge Disk: 19,616kB
7. 18.729 1,305.428 ↓ 1.6 74,102 3 / 3

Hash Join (cost=364,421.23..375,102.36 rows=47,770 width=181) (actual time=1,238.872..1,305.428 rows=74,102 loops=3)

8. 93.275 1,286.679 ↓ 1.6 74,102 3 / 3

Hash Join (cost=364,419.67..374,443.96 rows=47,770 width=159) (actual time=1,238.828..1,286.679 rows=74,102 loops=3)

9. 14.511 14.511 ↑ 1.2 100,000 3 / 3

Seq Scan on customer customer (cost=0..8,419 rows=125,000 width=147) (actual time=0.008..14.511 rows=100,000 loops=3)

10. 34.709 1,178.893 ↓ 1.6 74,102 3 / 3

Hash (cost=363,822.55..363,822.55 rows=47,770 width=16) (actual time=1,178.892..1,178.893 rows=74,102 loops=3)

11. 191.570 1,144.184 ↓ 1.6 74,102 3 / 3

Hash Join (cost=71,534.1..363,822.55 rows=47,770 width=16) (actual time=152.247..1,144.184 rows=74,102 loops=3)

12. 800.717 800.717 ↑ 1.3 987,472 3 / 3

Seq Scan on lineitem lineitem (cost=0..287,409.56 rows=1,247,958 width=16) (actual time=0.009..800.717 rows=987,472 loops=3)

  • Filter: (l_returnflag = 'R'::bpchar)
13. 9.565 151.897 ↑ 1.3 36,910 3 / 3

Hash (cost=70,936..70,936 rows=47,848 width=8) (actual time=151.897..151.897 rows=36,910 loops=3)

14. 142.332 142.332 ↑ 1.3 36,910 3 / 3

Seq Scan on orders orders (cost=0..70,936 rows=47,848 width=8) (actual time=0.011..142.332 rows=36,910 loops=3)

  • Filter: ((o_orderdate >= '1993-02-01'::date) AND (o_orderdate < '1993-05-01'::date))
15. 0.007 0.020 ↑ 1.0 25 3 / 3

Hash (cost=1.25..1.25 rows=25 width=30) (actual time=0.02..0.02 rows=25 loops=3)

16. 0.013 0.013 ↑ 1.0 25 3 / 3

Seq Scan on nation nation (cost=0..1.25 rows=25 width=30) (actual time=0.009..0.013 rows=25 loops=3)

Planning time : 0.584 ms
Execution time : 1,672.592 ms