explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4vbS

Settings
# exclusive inclusive rows x rows loops node
1. 17,650.316 191,491.015 ↑ 1.0 36,969,863 1

Merge Left Join (cost=3,210.98..3,327,915.35 rows=36,969,864 width=60) (actual time=120,479.029..191,491.015 rows=36,969,863 loops=1)

  • Merge Cond: ((comtrade_data_annual_refined.commodity_code = comtrade_data_annual.commodity_code) AND (comtrade_data_annual_refined.year = comtrade_data_annual.year) AND (comtrade_data_annual_refined.reporter_co
2. 31,907.086 31,907.086 ↑ 1.0 36,969,863 1

Index Only Scan using raw_ref_join_index on comtrade_data_annual_refined (cost=0.56..2,861,852.45 rows=36,969,864 width=28) (actual time=0.039..31,907.086 rows=36,969,863 loops=1)

  • Heap Fetches: 36969863
3. 3,041.972 141,933.613 ↓ 1,118.7 29,661,694 1

Materialize (cost=3,210.41..3,608.14 rows=26,515 width=108) (actual time=120,477.158..141,933.613 rows=29,661,694 loops=1)

4. 128,888.074 138,891.641 ↓ 1,118.7 29,661,694 1

Sort (cost=3,210.41..3,276.70 rows=26,515 width=108) (actual time=120,477.154..138,891.641 rows=29,661,694 loops=1)

  • Sort Key: comtrade_data_annual.commodity_code, comtrade_data_annual.year, comtrade_data_annual.reporter_code, comtrade_data_annual.partner_code, comtrade_data_annual.trade_flow_code
  • Sort Method: external merge Disk: 1058928kB
5. 10,003.567 10,003.567 ↓ 1,118.7 29,661,694 1

Index Only Scan using ref_raw_join_index on comtrade_data_annual (cost=0.56..1,262.29 rows=26,515 width=108) (actual time=0.023..10,003.567 rows=29,661,694 loops=1)

  • Heap Fetches: 0