explain.depesz.com

PostgreSQL's explain analyze made readable

Result: X02N : V2

Settings
# exclusive inclusive rows x rows loops node
1. 0.019 148.124 ↓ 3.0 3 1

Sort (cost=70,924.09..70,924.09 rows=1 width=1,386) (actual time=148.123..148.124 rows=3 loops=1)

  • Sort Key: mddealer.customercode, cmmregdoc.frame_no_
  • Sort Method: quicksort Memory: 26kB
2.          

CTE mddealer

3. 0.177 3.432 ↓ 2.8 560 1

Hash Join (cost=315.20..547.83 rows=202 width=67) (actual time=2.583..3.432 rows=560 loops=1)

  • Hash Cond: ((mst.area_id_)::text = (cmmareamst.geography_id_)::text)
4. 0.252 3.235 ↓ 2.8 560 1

Hash Join (cost=313.62..543.47 rows=202 width=93) (actual time=2.536..3.235 rows=560 loops=1)

  • Hash Cond: ((relation.from_organization_id_)::text = (mst.organization_id_)::text)
5. 0.482 0.482 ↓ 1.2 560 1

Index Only Scan using cmm_party_relation_idx01 on cmm_party_relation relation (cost=0.41..225.36 rows=460 width=71) (actual time=0.021..0.482 rows=560 loops=1)

  • Index Cond: ((site_id_ = '6548'::text) AND (party_relation_type_id_ = 'C028DEALERUNITMAINDEALER'::text))
  • Heap Fetches: 560
6. 1.173 2.501 ↑ 1.0 3,565 1

Hash (cost=268.65..268.65 rows=3,565 width=95) (actual time=2.501..2.501 rows=3,565 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 451kB
7. 1.328 1.328 ↑ 1.0 3,565 1

Seq Scan on cmm_site_mst mst (cost=0.00..268.65 rows=3,565 width=95) (actual time=0.005..1.328 rows=3,565 loops=1)

8. 0.005 0.020 ↑ 1.0 26 1

Hash (cost=1.26..1.26 rows=26 width=48) (actual time=0.020..0.020 rows=26 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
9. 0.015 0.015 ↑ 1.0 26 1

Seq Scan on cmm_area_mst cmmareamst (cost=0.00..1.26 rows=26 width=48) (actual time=0.006..0.015 rows=26 loops=1)

10. 2.342 148.105 ↓ 3.0 3 1

Nested Loop (cost=1.40..70,376.25 rows=1 width=1,386) (actual time=139.950..148.105 rows=3 loops=1)

  • Join Filter: ((mddealer.to_organization_id_)::text = (mdsite.organization_id_)::text)
  • Rows Removed by Join Filter: 10692
11. 0.009 144.506 ↓ 3.0 3 1

Nested Loop (cost=1.40..70,063.03 rows=1 width=1,462) (actual time=139.378..144.506 rows=3 loops=1)

12. 0.216 144.467 ↓ 3.0 3 1

Nested Loop (cost=0.99..70,062.44 rows=1 width=1,464) (actual time=139.360..144.467 rows=3 loops=1)

  • Join Filter: ((cmmregdoc.site_id_)::text = (mddealer.customercode)::text)
  • Rows Removed by Join Filter: 1677
13. 0.046 140.402 ↓ 3.0 3 1

Nested Loop (cost=0.99..70,055.87 rows=1 width=243) (actual time=136.718..140.402 rows=3 loops=1)

14. 139.990 139.990 ↓ 61.0 61 1

Index Scan using faktur_nik_document_01 on cmm_faktur_nik_document fk (cost=0.43..70,051.28 rows=1 width=110) (actual time=136.676..139.990 rows=61 loops=1)

  • Index Cond: ((status_)::text = 'C176WAITINGFORALLOCAPPROVE'::text)
15. 0.366 0.366 ↓ 0.0 0 61

Index Scan using cmm_registration_document_pkey on cmm_registration_document cmmregdoc (cost=0.56..4.58 rows=1 width=163) (actual time=0.006..0.006 rows=0 loops=61)

  • Index Cond: ((registration_document_id_)::text = (fk.registration_document_id_)::text)
  • Filter: (((request_faktur_date_)::text >= '20191005'::text) AND ((request_faktur_date_)::text <= '20191105'::text))
  • Rows Removed by Filter: 1
16. 3.849 3.849 ↓ 2.8 560 3

CTE Scan on mddealer (cost=0.00..4.04 rows=202 width=1,228) (actual time=0.862..1.283 rows=560 loops=3)

17. 0.030 0.030 ↑ 1.0 1 3

Index Scan using pk_product on cmm_product cmmpro (cost=0.42..0.58 rows=1 width=72) (actual time=0.009..0.010 rows=1 loops=3)

  • Index Cond: ((product_id_)::text = (cmmregdoc.product_id_)::text)
18. 1.257 1.257 ↑ 1.0 3,565 3

Seq Scan on cmm_site_mst mdsite (cost=0.00..268.65 rows=3,565 width=58) (actual time=0.001..0.419 rows=3,565 loops=3)

Planning time : 1.159 ms
Execution time : 148.260 ms