explain.depesz.com

PostgreSQL's explain analyze made readable

Result: x6eU

Settings
# exclusive inclusive rows x rows loops node
1. 2,012.203 6,748.779 ↓ 4.1 569,931 1

+-WindowAgg (cost=128,580.07..131,379.75 rows=139,984 width=106) (actual time=6,248.586..6,748.779 rows=569,931 loops=1)

  • +-Sort (cost=128,580.07..128930.03 rows=139,984 width=78) (actual time=6,248.564..6506.822 rows=569,931 loops=1) Sort Key: comp_orgz_sum.duns_no, comp_orgz_sum.comp_orgz_amt_kg DESC Sort Method: external merge Disk: 19,440kB
2. 50.956 4,736.576 ↓ 4.1 569,931 1

+-Subquery Scan on comp_orgz_sum (cost=105,842.52..110,392.00 rows=139,984 width=78) (actual time=3,815.136..4,736.576 rows=569,931 loops=1)

3. 2,426.509 4,685.620 ↓ 4.1 569,931 1

+-WindowAgg (cost=105,842.52..108,992.16 rows=139,984 width=98) (actual time=3,815.135..4,685.620 rows=569,931 loops=1)

  • +-Sort (cost=105,842.52..106192.48 rows=139,984 width=50) (actual time=3,815.109..4213.430 rows=569,931 loops=1) Sort Key: v.duns_no, v.jt_comp_cd, v.orgz_cd Sort Method: external merge Disk: 19,208kB
4. 2,108.586 2,259.111 ↓ 4.1 569,931 1

+-Subquery Scan on v (cost=87,339.66..89,089.46 rows=139,984 width=50) (actual time=1,860.828..2,259.111 rows=569,931 loops=1)

  • +-Sort (cost=87,339.66..87689.62 rows=139,984 width=113) (actual time=1,860.826..2200.482 rows=569,931 loops=1) Sort Key: (CASE WHEN ((sire_hz.duns_no IS NULL) OR ((sire_hz.duns_no)::text = ''::text)) THEN sire_hz.duns_no_dummy ELSE sire_hz.duns_no END), js_sum.kk_y Sort Method: external merge Disk: 22,040kB
  • +-Hash Left Join (cost=384.15..66761.09 rows=139,984 width=113) (actual time=2.757..782.219 rows=569,931 loops=1) Hash Cond: ((js_sum.sire_cd)::text = (sire_hz.sire_cd)::text)
  • +-Nested Loop (cost=0.00..65659.37 rows=139,984 width=30) (actual time=0.143..647.880 rows=569,931 loops=1) Join Filter: (((js_sum.kk_ym)::text >= (kikan.start_y_m)::text) AND ((js_sum.kk_ym)::text <= (kikan.end_y_m)::text)) Rows Removed by Join Filter: 689,922
  • | +-Seq Scan on ghg_m_ks_kk_rate_set kikan (cost=0.00..1.04 rows=1 width=14) (actual time=0.011..0.013 rows=1 loops=1) Filter: (((jisi_flag)::text = '0'::text) AND ((ks_y)::text = '2019'::text)) Rows Removed by Filter: 2
  • +-Hash (cost=259.07..259.07 rows=10,006 width=31) (actual time=2.550..2.550 rows=10,006 loops=1) Buckets: 16,384 Batches: 1 Memory Usage: 646kB
5. 150.525 150.525 ↑ 1.0 1,259,853 1

| +-Seq Scan on gha_m_kk_th_js_sum js_sum (cost=0.00..46,760.53 rows=1,259,853 width=37) (actual time=0.127..150.525 rows=1,259,853 loops=1)

  • +-Seq Scan on gha_m_dn_sire_hz sire_hz (cost=0.00..259.07 rows=10,006 width=31) (actual time=0.028..1.345 rows=10,006 loops=1) Filter: ((del_flg)::text = '0'::text)
Planning time : 0.396 ms
Execution time : 6,779.363 ms