explain.depesz.com

PostgreSQL's explain analyze made readable

Result: N2wt : v10

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

Sort (cost=107,014.68..107,014.69 rows=1 width=753) (actual time=138.629..138.629 rows=1 loops=1)

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

CTE mddealer

3. 0.221 5.588 ↓ 2.2 614 1

Hash Join (cost=199.50..553.24 rows=277 width=522) (actual time=3.866..5.588 rows=614 loops=1)

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

Hash Join (cost=188.15..538.08 rows=277 width=42) (actual time=3.802..5.337 rows=614 loops=1)

  • Hash Cond: ((relation.from_organization_id_)::text = (mst.organization_id_)::text)
5. 1.729 1.729 ↓ 1.1 614 1

Seq Scan on cmm_party_relation relation (cost=0.00..342.82 rows=579 width=36) (actual time=0.520..1.729 rows=614 loops=1)

  • Filter: ((party_relation_type_id_)::text = 'C028DEALERUNITMAINDEALER'::text)
  • Rows Removed by Filter: 6664
6. 1.437 3.263 ↑ 1.0 3,528 1

Hash (cost=142.51..142.51 rows=3,651 width=78) (actual time=3.263..3.263 rows=3,528 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 389kB
7. 1.826 1.826 ↑ 1.0 3,528 1

Seq Scan on cmm_site_mst mst (cost=0.00..142.51 rows=3,651 width=78) (actual time=0.007..1.826 rows=3,528 loops=1)

8. 0.014 0.030 ↑ 2.3 26 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
9. 0.016 0.016 ↑ 2.3 26 1

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

10. 0.009 138.618 ↑ 1.0 1 1

Nested Loop (cost=1.40..106,461.43 rows=1 width=753) (actual time=136.298..138.618 rows=1 loops=1)

11. 0.422 138.598 ↑ 1.0 1 1

Nested Loop (cost=0.99..106,456.98 rows=1 width=754) (actual time=136.279..138.598 rows=1 loops=1)

  • Join Filter: ((cmmorginfo.party_id_)::text = (cmmparty.party_id_)::text)
  • Rows Removed by Join Filter: 3976
12. 0.551 137.734 ↑ 1.0 1 1

Nested Loop (cost=0.99..106,291.53 rows=1 width=819) (actual time=135.430..137.734 rows=1 loops=1)

  • Join Filter: ((cmmregdoc.organization_id_)::text = (cmmorginfo.party_id_)::text)
  • Rows Removed by Join Filter: 3893
13. 0.089 136.642 ↑ 1.0 1 1

Nested Loop (cost=0.99..105,994.34 rows=1 width=767) (actual time=135.415..136.642 rows=1 loops=1)

  • Join Filter: ((cmmregdoc.site_id_)::text = (mddealer.site_code_)::text)
  • Rows Removed by Join Filter: 613
14. 0.020 130.755 ↑ 1.0 1 1

Nested Loop (cost=0.99..105,985.34 rows=1 width=258) (actual time=130.568..130.755 rows=1 loops=1)

15. 130.600 130.600 ↓ 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=88) (actual time=17.798..130.600 rows=9 loops=1)

  • Index Cond: ((status_)::text = 'C176WAITINGFORALLOCAPPROVE'::text)
  • Filter: (faktur_print_times_ > 1)
16. 0.135 0.135 ↓ 0.0 0 9

Index Scan using cmm_registration_document_pkey on cmm_registration_document cmmregdoc (cost=0.43..4.46 rows=1 width=194) (actual time=0.015..0.015 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))
  • Rows Removed by Filter: 1
17. 5.798 5.798 ↓ 2.2 614 1

CTE Scan on mddealer (cost=0.00..5.54 rows=277 width=614) (actual time=3.870..5.798 rows=614 loops=1)

18. 0.541 0.541 ↓ 1.0 3,894 1

Seq Scan on cmm_organization_info cmmorginfo (cost=0.00..248.75 rows=3,875 width=52) (actual time=0.003..0.541 rows=3,894 loops=1)

19. 0.442 0.442 ↑ 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.003..0.442 rows=3,977 loops=1)

20. 0.011 0.011 ↑ 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.010..0.011 rows=1 loops=1)

  • Index Cond: ((product_id_)::text = (cmmregdoc.product_id_)::text)
Planning time : 2.721 ms
Execution time : 138.829 ms