explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jWBk

Settings
# exclusive inclusive rows x rows loops node
1. 0.564 3,899.051 ↑ 39.6 9 1

HashAggregate (cost=55,217.39..55,222.73 rows=356 width=40) (actual time=3,899.044..3,899.051 rows=9 loops=1)

  • Group Key: d.partner_id
2. 209.921 3,898.487 ↑ 415.8 1,136 1

Merge Left Join (cost=44,718.69..52,855.46 rows=472,386 width=14) (actual time=3,240.830..3,898.487 rows=1,136 loops=1)

  • Merge Cond: ((tr.barcode)::text = (tr_1.barcode)::text)
3. 3.351 9.278 ↑ 125.7 1,119 1

Sort (cost=22,353.12..22,704.69 rows=140,628 width=21) (actual time=9.101..9.278 rows=1,119 loops=1)

  • Sort Key: tr.barcode
  • Sort Method: quicksort Memory: 136kB
4. 0.213 5.927 ↑ 125.7 1,119 1

Nested Loop (cost=0.70..8,639.15 rows=140,628 width=21) (actual time=0.069..5.927 rows=1,119 loops=1)

5. 0.627 1.766 ↑ 2.4 188 1

Nested Loop (cost=0.28..100.33 rows=449 width=16) (actual time=0.041..1.766 rows=188 loops=1)

  • Join Filter: (d.doc_type_id = dt.doc_type_id)
  • Rows Removed by Join Filter: 1742
6. 1.139 1.139 ↓ 1.1 1,930 1

Index Scan using parnter_id on t_doc d (cost=0.28..72.32 rows=1,797 width=20) (actual time=0.027..1.139 rows=1,930 loops=1)

  • Filter: (NOT deleted)
7. 0.000 0.000 ↑ 1.0 1 1,930

Materialize (cost=0.00..1.05 rows=1 width=4) (actual time=0.000..0.000 rows=1 loops=1,930)

8. 0.006 0.006 ↑ 1.0 1 1

Seq Scan on t_doc_type dt (cost=0.00..1.05 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=1)

  • Filter: ((brief)::text = 'OUTDOC'::text)
  • Rows Removed by Filter: 3
9. 3.948 3.948 ↑ 67.8 6 188

Index Scan using doc_id_idx on t_tran tr (cost=0.42..14.95 rows=407 width=21) (actual time=0.015..0.021 rows=6 loops=188)

  • Index Cond: (doc_id = d.doc_id)
  • Filter: (NOT deleted)
  • Rows Removed by Filter: 48
10. 67.440 3,679.288 ↓ 4.0 561,879 1

Materialize (cost=22,365.58..23,069.11 rows=140,706 width=19) (actual time=3,192.454..3,679.288 rows=561,879 loops=1)

11. 3,305.199 3,611.848 ↓ 4.0 561,872 1

Sort (cost=22,365.58..22,717.34 rows=140,706 width=19) (actual time=3,192.451..3,611.848 rows=561,872 loops=1)

  • Sort Key: tr_1.barcode
  • Sort Method: external merge Disk: 17088kB
12. 77.120 306.649 ↓ 4.0 562,760 1

Nested Loop (cost=0.70..8,642.33 rows=140,706 width=19) (actual time=0.038..306.649 rows=562,760 loops=1)

13. 0.965 2.225 ↓ 3.8 1,722 1

Nested Loop (cost=0.28..103.51 rows=449 width=8) (actual time=0.025..2.225 rows=1,722 loops=1)

  • Join Filter: (d_1.doc_type_id = dt_1.doc_type_id)
  • Rows Removed by Join Filter: 208
14. 1.260 1.260 ↓ 1.1 1,930 1

Index Scan using t_doc_pkey on t_doc d_1 (cost=0.28..75.50 rows=1,797 width=12) (actual time=0.012..1.260 rows=1,930 loops=1)

  • Filter: (NOT deleted)
15. 0.000 0.000 ↑ 1.0 1 1,930

Materialize (cost=0.00..1.05 rows=1 width=4) (actual time=0.000..0.000 rows=1 loops=1,930)

16. 0.011 0.011 ↑ 1.0 1 1

Seq Scan on t_doc_type dt_1 (cost=0.00..1.05 rows=1 width=4) (actual time=0.007..0.011 rows=1 loops=1)

  • Filter: ((brief)::text = 'INDOC'::text)
  • Rows Removed by Filter: 3
17. 227.304 227.304 ↑ 1.2 327 1,722

Index Scan using doc_id_idx on t_tran tr_1 (cost=0.42..14.95 rows=407 width=27) (actual time=0.005..0.132 rows=327 loops=1,722)

  • Index Cond: (doc_id = d_1.doc_id)
  • Filter: (NOT deleted)
Planning time : 1.021 ms
Execution time : 3,902.713 ms