explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Yg29

Settings
# exclusive inclusive rows x rows loops node
1. 20.477 1,697.810 ↑ 1.0 20 1

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

2. 30.268 1,677.333 ↑ 5,732.4 20 1

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

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

GroupAggregate (cost=384,060.52..400,581.75 rows=114,647 width=201) (actual time=1,460.272..1,647.065 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. 28.843 1,585.250 ↑ 1.3 74,259 1

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

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

GroupAggregate (cost=383,060.5..384,971.3 rows=47,770 width=201) (actual time=1,453.825..1,556.407 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. 154.516 1,472.965 ↓ 1.6 74,102 3 / 3

Sort (cost=383,060.5..383,179.93 rows=47,770 width=181) (actual time=1,453.806..1,472.965 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: 11,656kB
7. 19.098 1,318.449 ↓ 1.6 74,102 3 / 3

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

8. 95.250 1,299.331 ↓ 1.6 74,102 3 / 3

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

9. 14.679 14.679 ↑ 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.679 rows=100,000 loops=3)

10. 37.849 1,189.402 ↓ 1.6 74,102 3 / 3

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

11. 191.718 1,151.553 ↓ 1.6 74,102 3 / 3

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

12. 806.345 806.345 ↑ 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..806.345 rows=987,472 loops=3)

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

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

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

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

  • Filter: ((o_orderdate >= '1993-02-01'::date) AND (o_orderdate < '1993-05-01'::date))
15. 0.008 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.012 0.012 ↑ 1.0 25 3 / 3

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

Planning time : 0.336 ms
Execution time : 1,699.731 ms