explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5bcs : V3

Settings
# exclusive inclusive rows x rows loops node
1. 0.029 142.311 ↓ 3.0 3 1

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

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

CTE mddealer

3. 0.168 3.459 ↓ 2.8 560 1

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

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

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

  • Hash Cond: ((relation.from_organization_id_)::text = (mst.organization_id_)::text)
5. 0.469 0.469 ↓ 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.022..0.469 rows=560 loops=1)

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

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

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

8. 0.012 0.021 ↑ 1.0 26 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
9. 0.009 0.009 ↑ 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.009 rows=26 loops=1)

10. 0.014 142.282 ↓ 3.0 3 1

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

11. 0.214 142.238 ↓ 3.0 3 1

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

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

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

13. 137.781 137.781 ↓ 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=134.695..137.781 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.807 3.807 ↓ 2.8 560 3

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

16. 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.010..0.010 rows=1 loops=3)

  • Index Cond: ((product_id_)::text = (cmmregdoc.product_id_)::text)
Planning time : 1.000 ms
Execution time : 142.432 ms