explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FA5gA : V2

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 151.747 ↓ 3.0 3 1

Sort (cost=70,925.85..70,925.85 rows=1 width=1,978) (actual time=151.746..151.747 rows=3 loops=1)

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

CTE mddealer

3. 0.189 5.684 ↓ 3.1 560 1

Hash Join (cost=628.42..863.87 rows=183 width=55) (actual time=4.592..5.684 rows=560 loops=1)

  • Hash Cond: ((mst.area_id_)::text = (cmmareamst.geography_id_)::text)
4. 0.212 5.474 ↓ 3.1 560 1

Hash Join (cost=626.83..859.77 rows=183 width=81) (actual time=4.551..5.474 rows=560 loops=1)

  • Hash Cond: ((relation.to_organization_id_)::text = (mdsite.organization_id_)::text)
5. 0.289 2.924 ↓ 2.8 560 1

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

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

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

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

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

9. 1.028 2.338 ↑ 1.0 3,565 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 322kB
10. 1.310 1.310 ↑ 1.0 3,565 1

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

11. 0.010 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
12. 0.011 0.011 ↑ 1.0 26 1

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

13. 0.013 151.732 ↓ 3.0 3 1

Nested Loop (cost=1.40..70,061.97 rows=1 width=1,978) (actual time=146.493..151.732 rows=3 loops=1)

14. 0.217 151.692 ↓ 3.0 3 1

Nested Loop (cost=0.99..70,061.37 rows=1 width=1,980) (actual time=146.472..151.692 rows=3 loops=1)

  • Join Filter: ((cmmregdoc.site_id_)::text = (mddealer.customercode)::text)
  • Rows Removed by Join Filter: 1677
15. 0.042 145.385 ↓ 3.0 3 1

Nested Loop (cost=0.99..70,055.42 rows=1 width=243) (actual time=141.803..145.385 rows=3 loops=1)

16. 144.977 144.977 ↓ 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=110) (actual time=141.752..144.977 rows=61 loops=1)

  • Index Cond: ((status_)::text = 'C176WAITINGFORALLOCAPPROVE'::text)
17. 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
18. 6.090 6.090 ↓ 3.1 560 3

CTE Scan on mddealer (cost=0.00..3.66 rows=183 width=1,744) (actual time=1.532..2.030 rows=560 loops=3)

19. 0.027 0.027 ↑ 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.008..0.009 rows=1 loops=3)

  • Index Cond: ((product_id_)::text = (cmmregdoc.product_id_)::text)
Planning time : 1.463 ms
Execution time : 151.897 ms