explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nwls : V13

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 112.281 ↑ 1.0 1 1

Sort (cost=106,405.17..106,405.17 rows=1 width=1,006) (actual time=112.281..112.281 rows=1 loops=1)

  • Sort Key: mddealer.party_code_, cmmregdoc.frame_no_
  • Sort Method: quicksort Memory: 25kB
2.          

CTE mddealer

3. 0.260 6.003 ↓ 2.2 614 1

Hash Join (cost=177.77..406.37 rows=277 width=545) (actual time=1.816..6.003 rows=614 loops=1)

  • Hash Cond: ((mst.area_id_)::text = (cmmareamst.geography_id_)::text)
4. 0.439 5.723 ↓ 2.2 614 1

Nested Loop (cost=166.42..391.21 rows=277 width=65) (actual time=1.781..5.723 rows=614 loops=1)

  • Join Filter: ((relation.from_organization_id_)::text = (mst.organization_id_)::text)
5. 0.411 4.056 ↓ 4.6 614 1

Nested Loop (cost=166.14..340.25 rows=133 width=131) (actual time=1.767..4.056 rows=614 loops=1)

  • Join Filter: ((relation.from_organization_id_)::text = (cmmorginfo.party_id_)::text)
6. 0.339 2.417 ↓ 2.2 614 1

Hash Join (cost=165.86..214.55 rows=277 width=79) (actual time=1.754..2.417 rows=614 loops=1)

  • Hash Cond: ((relation.from_organization_id_)::text = (cmmparty.party_id_)::text)
7. 0.347 0.347 ↓ 1.1 614 1

Index Only Scan using cmm_party_relation_idx01 on cmm_party_relation relation (cost=0.41..41.99 rows=579 width=36) (actual time=0.014..0.347 rows=614 loops=1)

  • Index Cond: ((site_id_ = '6548'::text) AND (party_relation_type_id_ = 'C028DEALERUNITMAINDEALER'::text))
  • Heap Fetches: 98
8. 0.881 1.731 ↑ 1.0 3,977 1

Hash (cost=115.20..115.20 rows=4,020 width=43) (actual time=1.731..1.731 rows=3,977 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 295kB
9. 0.850 0.850 ↑ 1.0 3,977 1

Seq Scan on cmm_party_info cmmparty (cost=0.00..115.20 rows=4,020 width=43) (actual time=0.005..0.850 rows=3,977 loops=1)

10. 1.228 1.228 ↑ 1.0 1 614

Index Scan using pk_cmm_organization_info on cmm_organization_info cmmorginfo (cost=0.28..0.44 rows=1 width=52) (actual time=0.002..0.002 rows=1 loops=614)

  • Index Cond: ((party_id_)::text = (cmmparty.party_id_)::text)
11. 1.228 1.228 ↑ 1.0 1 614

Index Scan using cmm_site_mst_idx02 on cmm_site_mst mst (cost=0.28..0.37 rows=1 width=78) (actual time=0.002..0.002 rows=1 loops=614)

  • Index Cond: ((organization_id_)::text = (cmmparty.party_id_)::text)
12. 0.011 0.020 ↑ 2.3 26 1

Hash (cost=10.60..10.60 rows=60 width=614) (actual time=0.020..0.020 rows=26 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
13. 0.009 0.009 ↑ 2.3 26 1

Seq Scan on cmm_area_mst cmmareamst (cost=0.00..10.60 rows=60 width=614) (actual time=0.005..0.009 rows=26 loops=1)

14. 0.009 112.270 ↑ 1.0 1 1

Nested Loop (cost=1.40..105,998.79 rows=1 width=1,006) (actual time=110.532..112.270 rows=1 loops=1)

15. 0.116 112.251 ↑ 1.0 1 1

Nested Loop (cost=0.99..105,994.34 rows=1 width=1,007) (actual time=110.514..112.251 rows=1 loops=1)

  • Join Filter: ((cmmregdoc.site_id_)::text = (mddealer.site_code_)::text)
  • Rows Removed by Join Filter: 613
16. 0.024 105.774 ↑ 1.0 1 1

Nested Loop (cost=0.99..105,985.34 rows=1 width=229) (actual time=105.636..105.774 rows=1 loops=1)

17. 105.642 105.642 ↓ 9.0 9 1

Index Scan using faktur_nik_document_01 on cmm_faktur_nik_document fk (cost=0.56..105,980.87 rows=1 width=95) (actual time=14.211..105.642 rows=9 loops=1)

  • Index Cond: ((status_)::text = 'C176WAITINGFORALLOCAPPROVE'::text)
18. 0.108 0.108 ↓ 0.0 0 9

Index Scan using cmm_registration_document_pkey on cmm_registration_document cmmregdoc (cost=0.43..4.46 rows=1 width=158) (actual time=0.012..0.012 rows=0 loops=9)

  • 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) AND ((fk.site_id_)::text = (site_id_)::text))
  • Rows Removed by Filter: 1
19. 6.361 6.361 ↓ 2.2 614 1

CTE Scan on mddealer (cost=0.00..5.54 rows=277 width=890) (actual time=1.819..6.361 rows=614 loops=1)

20. 0.010 0.010 ↑ 1.0 1 1

Index Scan using pk_product_add on cmm_product cmmpro (cost=0.42..4.44 rows=1 width=73) (actual time=0.009..0.010 rows=1 loops=1)

  • Index Cond: ((product_id_)::text = (cmmregdoc.product_id_)::text)
Planning time : 2.132 ms
Execution time : 112.428 ms