explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Crgr

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=2,260,191.95..2,263,412.97 rows=42,947 width=504) (actual rows= loops=)

  • Group Key: a.pasoknama, a.pasokalmt, a.impnama, a.impalmt, a.pelmuat, a.pelbkr, (substr((cc.nohs)::text, 1, 4)), dd.uraian_id, (sum(cc.nettodtl)), a.kdval, (CASE WHEN (a.nilinv = a.fob) THEN 'FOB'::text WHEN (a.nilinv = a.cif) THEN 'CIF'::text ELSE NULL::text END)
2. 0.000 0.000 ↓ 0.0

Sort (cost=2,260,191.95..2,260,299.32 rows=42,947 width=312) (actual rows= loops=)

  • Sort Key: a.pasoknama, a.pasokalmt, a.impnama, a.impalmt, a.pelmuat, a.pelbkr, (substr((cc.nohs)::text, 1, 4)), dd.uraian_id, (sum(cc.nettodtl)), a.kdval, (CASE WHEN (a.nilinv = a.fob) THEN 'FOB'::text WHEN (a.nilinv = a.cif) THEN 'CIF'::text ELSE NULL::text END)
3. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,959,947.57..2,256,887.12 rows=42,947 width=312) (actual rows= loops=)

  • Hash Cond: (a.cusdecid = c.cusdecid)
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,830,811.05..2,126,993.66 rows=42,947 width=296) (actual rows= loops=)

  • Join Filter: (b.cusdecid = a.cusdecid)
5. 0.000 0.000 ↓ 0.0

Merge Join (cost=1,830,810.62..2,037,193.00 rows=56,367 width=103) (actual rows= loops=)

  • Merge Cond: (aa.cusdecid = b.cusdecid)
6. 0.000 0.000 ↓ 0.0

Finalize GroupAggregate (cost=1,800,947.46..1,987,760.10 rows=1,465,917 width=95) (actual rows= loops=)

  • Group Key: aa.cusdecid, (substr((cc.nohs)::text, 1, 4)), dd.uraian_id
7. 0.000 0.000 ↓ 0.0

Gather Merge (cost=1,800,947.46..1,957,220.16 rows=1,221,598 width=95) (actual rows= loops=)

  • Workers Planned: 2
8. 0.000 0.000 ↓ 0.0

Partial GroupAggregate (cost=1,799,947.44..1,815,217.41 rows=610,799 width=95) (actual rows= loops=)

  • Group Key: aa.cusdecid, (substr((cc.nohs)::text, 1, 4)), dd.uraian_id
9. 0.000 0.000 ↓ 0.0

Sort (cost=1,799,947.44..1,801,474.44 rows=610,799 width=95) (actual rows= loops=)

  • Sort Key: aa.cusdecid, (substr((cc.nohs)::text, 1, 4)), dd.uraian_id
10. 0.000 0.000 ↓ 0.0

Hash Join (cost=715.61..1,709,930.62 rows=610,799 width=95) (actual rows= loops=)

  • Hash Cond: (substr((cc.nohs)::text, 1, 4) = (dd.hs_code_format)::text)
11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.43..1,695,531.56 rows=604,990 width=25) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.86..263,093.00 rows=40,455 width=16) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Parallel Index Scan using idx_tbltracking_date_wkrekam on tbltrackinghdr bb (cost=0.43..17,181.04 rows=56,842 width=8) (actual rows= loops=)

  • Index Cond: (((wk_rekam)::date >= to_date('20180101'::text, 'yyyyMMdd'::text)) AND ((wk_rekam)::date <= to_date('20180131'::text, 'yyyyMMdd'::text)))
  • Filter: ((status)::text = '506'::text)
14. 0.000 0.000 ↓ 0.0

Index Scan using tblpibhdr_pkey on tblpibhdr aa (cost=0.43..4.33 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (cusdecid = bb.cusdecid)
  • Filter: ((kdkpbc)::text = ANY ('{040300,050100}'::text[]))
15. 0.000 0.000 ↓ 0.0

Index Scan using tblpibdtl_pkey on tblpibdtl cc (cost=0.56..23.62 rows=1,179 width=25) (actual rows= loops=)

  • Index Cond: (cusdecid = aa.cusdecid)
16. 0.000 0.000 ↓ 0.0

Hash (cost=559.08..559.08 rows=12,408 width=55) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Seq Scan on td_btbmi dd (cost=0.00..559.08 rows=12,408 width=55) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Sort (cost=29,863.16..30,204.21 rows=136,422 width=8) (actual rows= loops=)

  • Sort Key: b.cusdecid
19. 0.000 0.000 ↓ 0.0

Index Scan using idx_tbltracking_date_wkrekam on tbltrackinghdr b (cost=0.43..18,227.92 rows=136,422 width=8) (actual rows= loops=)

  • Index Cond: (((wk_rekam)::date >= to_date('20180101'::text, 'yyyyMMdd'::text)) AND ((wk_rekam)::date <= to_date('20180131'::text, 'yyyyMMdd'::text)))
  • Filter: ((status)::text = '506'::text)
20. 0.000 0.000 ↓ 0.0

Index Scan using tblpibhdr_pkey on tblpibhdr a (cost=0.43..1.58 rows=1 width=209) (actual rows= loops=)

  • Index Cond: (cusdecid = aa.cusdecid)
  • Filter: ((kdkpbc)::text = ANY ('{040300,050100}'::text[]))
21. 0.000 0.000 ↓ 0.0

Hash (cost=124,665.55..124,665.55 rows=357,677 width=8) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Subquery Scan on c (cost=117,512.01..124,665.55 rows=357,677 width=8) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

HashAggregate (cost=117,512.01..121,088.78 rows=357,677 width=16) (actual rows= loops=)

  • Group Key: aa_1.cusdecid
24. 0.000 0.000 ↓ 0.0

Seq Scan on tblpibcon aa_1 (cost=0.00..103,524.61 rows=5,594,961 width=8) (actual rows= loops=)