explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fyYi

Settings
# exclusive inclusive rows x rows loops node
1. 5.311 1,292.037 ↑ 1.0 20 1

Limit (cost=510,623.29..510,623.34 rows=20 width=201) (actual time=1,286.726..1,292.037 rows=20 loops=1)

2. 33.770 1,286.726 ↑ 5,732.4 20 1

Sort (cost=510,623.29..510,909.91 rows=114,647 width=201) (actual time=1,286.724..1,286.726 rows=20 loops=1)

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

GroupAggregate (cost=491,051.35..507,572.57 rows=114,647 width=201) (actual time=1,040.488..1,252.956 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. 99.139 1,166.075 ↑ 1.3 74,259 1

Gather Merge (cost=491,051.35..503,989.84 rows=95,540 width=201) (actual time=1,040.476..1,166.075 rows=74,259 loops=1)

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

GroupAggregate (cost=490,051.33..491,962.13 rows=47,770 width=201) (actual time=972.074..1,066.936 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. 110.589 989.702 ↓ 1.6 74,102 3 / 3

Sort (cost=490,051.33..490,170.75 rows=47,770 width=181) (actual time=972.056..989.702 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: 12,248kB
7. 22.143 879.113 ↓ 1.6 74,102 3 / 3

Nested Loop (cost=144,236.84..482,093.19 rows=47,770 width=181) (actual time=685.536..879.113 rows=74,102 loops=3)

8. 11.454 709.329 ↑ 1.3 36,910 3 / 3

Merge Join (cost=144,236.41..145,193.37 rows=47,848 width=173) (actual time=685.498..709.329 rows=36,910 loops=3)

9. 38.896 695.766 ↑ 1.3 36,910 3 / 3

Sort (cost=144,234.58..144,354.2 rows=47,848 width=151) (actual time=685.458..695.766 rows=36,910 loops=3)

  • Sort Key: customer.c_nationkey
  • Sort Method: external merge Disk: 5,168kB
10. 28.384 656.870 ↑ 1.3 36,910 3 / 3

Merge Join (cost=135,239.65..136,917.31 rows=47,848 width=151) (actual time=595.095..656.87 rows=36,910 loops=3)

11. 82.193 105.879 ↑ 1.3 99,999 3 / 3

Sort (cost=28,402.23..28,714.73 rows=125,000 width=147) (actual time=86.618..105.879 rows=99,999 loops=3)

  • Sort Key: customer.c_custkey
  • Sort Method: external merge Disk: 13,736kB
12. 23.686 23.686 ↑ 1.2 100,000 3 / 3

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

13. 83.402 522.607 ↑ 1.0 109,922 3 / 3

Sort (cost=106,837.42..107,124.51 rows=114,835 width=8) (actual time=508.103..522.607 rows=109,922 loops=3)

  • Sort Key: orders.o_custkey
  • Sort Method: external sort Disk: 2,392kB
14. 439.205 439.205 ↑ 1.0 110,731 3 / 3

Seq Scan on orders orders (cost=0..97,186 rows=114,835 width=8) (actual time=0.032..439.205 rows=110,731 loops=3)

  • Filter: ((o_orderdate >= '1993-02-01'::date) AND (o_orderdate < '1993-05-01'::date))
15. 2.083 2.109 ↓ 1,416.6 35,415 3 / 3

Sort (cost=1.83..1.89 rows=25 width=30) (actual time=0.035..2.109 rows=35,415 loops=3)

  • Sort Key: nation.n_nationkey
  • Sort Method: quicksort Memory: 26kB
16. 0.026 0.026 ↑ 1.0 25 3 / 3

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

17. 147.641 147.641 ↑ 4.0 2 110,731 / 3

Index Scan using lineitem_okey_flag on lineitem lineitem (cost=0.43..6.96 rows=8 width=16) (actual time=0.004..0.004 rows=2 loops=110,731)

  • Index Cond: ((l_orderkey = orders.o_orderkey) AND (l_returnflag = 'R'::bpchar))
Planning time : 0.352 ms
Execution time : 1,296.629 ms