explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oZ5

Settings
# exclusive inclusive rows x rows loops node
1. 425.876 1,553.550 ↑ 2.2 142,333 1

Merge Full Join (cost=218,830.32..346,975.74 rows=320,092 width=120) (actual time=1,104.138..1,553.550 rows=142,333 loops=1)

  • Merge Cond: ((raw_monthly_imports.reporter_code = raw_monthly_exports.partner_code) AND (raw_monthly_imports.partner_code = raw_monthly_exports.reporter_code) AND (raw_monthly_imports.commodity_code = raw_month
  • Filter: (GREATEST((COALESCE(raw_monthly_imports.trade_value, '0'::text))::double precision, (COALESCE(raw_monthly_exports.trade_value, '0'::text))::double precision) > '0'::double precision)
  • Rows Removed by Filter: 6
2. 453.632 518.779 ↑ 8.9 107,789 1

Sort (cost=114,801.84..117,202.53 rows=960,276 width=39) (actual time=505.471..518.779 rows=107,789 loops=1)

  • Sort Key: raw_monthly_imports.reporter_code, raw_monthly_imports.partner_code, raw_monthly_imports.commodity_code, raw_monthly_imports.aggregate_level, raw_monthly_imports.year, raw_monthly_imports.period
  • Sort Method: quicksort Memory: 11494kB
3. 16.662 65.147 ↑ 8.9 107,789 1

Hash Left Join (cost=25.65..19,383.59 rows=960,276 width=39) (actual time=2.851..65.147 rows=107,789 loops=1)

  • Hash Cond: (raw_monthly_imports.reporter_code = ir.result_reporter_code)
4. 48.482 48.482 ↑ 1.5 107,789 1

Index Only Scan using agg_tf_rep_partial_monthly_v3 on comtrade_data_monthly raw_monthly_imports (cost=0.57..9,155.58 rows=160,046 width=35) (actual time=2.817..48.482 rows=107,789 loops=1)

  • Index Cond: ((period = '201010'::text) AND (reporter_code = 842))
  • Filter: (partner_code <> 0)
  • Rows Removed by Filter: 6118
  • Heap Fetches: 0
5. 0.001 0.003 ↓ 0.0 0 1

Hash (cost=25.00..25.00 rows=6 width=8) (actual time=0.002..0.003 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
6. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on import_reliability ir (cost=0.00..25.00 rows=6 width=8) (actual time=0.002..0.002 rows=0 loops=1)

  • Filter: (result_reporter_code = 842)
7. 561.589 608.895 ↑ 8.7 100,374 1

Sort (cost=104,028.47..106,215.97 rows=874,998 width=39) (actual time=598.617..608.895 rows=100,374 loops=1)

  • Sort Key: raw_monthly_exports.partner_code, raw_monthly_exports.reporter_code, raw_monthly_exports.commodity_code, raw_monthly_exports.aggregate_level, raw_monthly_exports.year, raw_monthly_exports.period
  • Sort Method: quicksort Memory: 10914kB
8. 12.673 47.306 ↑ 8.7 100,374 1

Hash Left Join (cost=25.65..17,670.90 rows=874,998 width=39) (actual time=2.172..47.306 rows=100,374 loops=1)

  • Hash Cond: (raw_monthly_exports.partner_code = er.result_reporter_code)
9. 34.630 34.630 ↑ 1.5 100,374 1

Index Only Scan using agg_tf_part_partial_monthly_v3 on comtrade_data_monthly raw_monthly_exports (cost=0.57..8,348.97 rows=145,833 width=35) (actual time=2.155..34.630 rows=100,374 loops=1)

  • Index Cond: ((period = '201010'::text) AND (partner_code = 842))
  • Heap Fetches: 0
10. 0.000 0.003 ↓ 0.0 0 1

Hash (cost=25.00..25.00 rows=6 width=8) (actual time=0.003..0.003 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
11. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on export_reliability er (cost=0.00..25.00 rows=6 width=8) (actual time=0.003..0.003 rows=0 loops=1)

  • Filter: (result_reporter_code = 842)