explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IfDx

Settings
# exclusive inclusive rows x rows loops node
1. 705.174 2,467.718 ↑ 3.0 281,210 1

Merge Full Join (cost=593,926.86..920,001.90 rows=849,500 width=84) (actual time=1,724.351..2,467.718 rows=281,210 loops=1)

  • Merge Cond: ((raw_annual_imports.reporter_code = raw_annual_exports.partner_code) AND (raw_annual_imports.partner_code = raw_annual_exports.reporter_code) AND (raw_annual_imports.commodity_code = raw_annual_exp
  • Filter: (GREATEST((COALESCE(raw_annual_imports.trade_value, '0'::text))::double precision, (COALESCE(raw_annual_exports.trade_value, '0'::text))::double precision) > '0'::double precision)
  • Rows Removed by Filter: 283
2. 802.855 878.429 ↑ 12.1 210,354 1

Sort (cost=320,418.95..326,790.20 rows=2,548,500 width=32) (actual time=853.626..878.429 rows=210,354 loops=1)

  • Sort Key: raw_annual_imports.reporter_code, raw_annual_imports.partner_code, raw_annual_imports.commodity_code, raw_annual_imports.aggregate_level, raw_annual_imports.year
  • Sort Method: quicksort Memory: 22578kB
3. 25.437 75.574 ↑ 12.1 210,354 1

Hash Left Join (cost=25.65..49,243.04 rows=2,548,500 width=32) (actual time=0.058..75.574 rows=210,354 loops=1)

  • Hash Cond: (raw_annual_imports.reporter_code = ir.result_reporter_code)
4. 50.135 50.135 ↑ 2.0 210,354 1

Index Only Scan using agg_tf_rep_partial_v2 on comtrade_data_annual raw_annual_imports (cost=0.57..22,140.15 rows=424,750 width=28) (actual time=0.036..50.135 rows=210,354 loops=1)

  • Index Cond: ((year = '2017'::text) AND (reporter_code = 842))
  • Filter: (partner_code <> 0)
  • Rows Removed by Filter: 6585
  • Heap Fetches: 0
5. 0.001 0.002 ↓ 0.0 0 1

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

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

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

  • Filter: (result_reporter_code = 842)
7. 805.793 884.115 ↑ 9.7 226,481 1

Sort (cost=273,507.91..278,992.53 rows=2,193,846 width=32) (actual time=870.678..884.115 rows=226,481 loops=1)

  • Sort Key: raw_annual_exports.partner_code, raw_annual_exports.reporter_code, raw_annual_exports.commodity_code, raw_annual_exports.aggregate_level, raw_annual_exports.year
  • Sort Method: quicksort Memory: 23838kB
8. 28.039 78.322 ↑ 9.7 226,481 1

Hash Left Join (cost=25.64..42,440.74 rows=2,193,846 width=32) (actual time=0.038..78.322 rows=226,481 loops=1)

  • Hash Cond: (raw_annual_exports.partner_code = er.result_reporter_code)
9. 50.278 50.278 ↑ 1.6 226,481 1

Index Only Scan using agg_tf_part_partial_v2 on comtrade_data_annual raw_annual_exports (cost=0.57..19,106.06 rows=365,641 width=28) (actual time=0.025..50.278 rows=226,481 loops=1)

  • Index Cond: ((year = '2017'::text) AND (partner_code = 842))
  • Heap Fetches: 0
10. 0.001 0.005 ↓ 0.0 0 1

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

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

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

  • Filter: (result_reporter_code = 842)
Planning time : 2.410 ms
Execution time : 2,484.063 ms