explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IoKw : V3

Settings
# exclusive inclusive rows x rows loops node
1. 0.027 173.053 ↓ 3.0 3 1

Sort (cost=70,610.42..70,610.43 rows=1 width=1,360) (actual time=173.052..173.053 rows=3 loops=1)

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

CTE mddealer

3. 0.189 3.568 ↓ 2.8 560 1

Hash Join (cost=315.20..547.83 rows=202 width=33) (actual time=2.696..3.568 rows=560 loops=1)

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

Hash Join (cost=313.62..543.47 rows=202 width=59) (actual time=2.656..3.359 rows=560 loops=1)

  • Hash Cond: ((relation.from_organization_id_)::text = (mst.organization_id_)::text)
5. 0.478 0.478 ↓ 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=37) (actual time=0.021..0.478 rows=560 loops=1)

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 451kB
7. 1.446 1.446 ↑ 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.004..1.446 rows=3,565 loops=1)

8. 0.010 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.010 0.010 ↑ 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.010 rows=26 loops=1)

10. 0.017 173.026 ↓ 3.0 3 1

Nested Loop (cost=1.40..70,062.59 rows=1 width=1,360) (actual time=167.013..173.026 rows=3 loops=1)

11. 0.214 172.973 ↓ 3.0 3 1

Nested Loop (cost=0.99..70,061.99 rows=1 width=1,362) (actual time=166.990..172.973 rows=3 loops=1)

  • Join Filter: ((cmmregdoc.site_id_)::text = (mddealer.customercode)::text)
  • Rows Removed by Join Filter: 1677
12. 0.065 168.823 ↓ 3.0 3 1

Nested Loop (cost=0.99..70,055.42 rows=1 width=239) (actual time=164.234..168.823 rows=3 loops=1)

13. 168.331 168.331 ↓ 61.0 61 1

Index Scan using faktur_nik_document_01 on cmm_faktur_nik_document fk (cost=0.43..70,050.83 rows=1 width=106) (actual time=164.184..168.331 rows=61 loops=1)

  • Index Cond: ((status_)::text = 'C176WAITINGFORALLOCAPPROVE'::text)
14. 0.427 0.427 ↓ 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.007..0.007 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
15. 3.936 3.936 ↓ 2.8 560 3

CTE Scan on mddealer (cost=0.00..4.04 rows=202 width=1,130) (actual time=0.900..1.312 rows=560 loops=3)

16. 0.036 0.036 ↑ 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.011..0.012 rows=1 loops=3)

  • Index Cond: ((product_id_)::text = (cmmregdoc.product_id_)::text)
Planning time : 1.481 ms
Execution time : 173.246 ms