explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AegC

Settings
# exclusive inclusive rows x rows loops node
1. 142.950 560.621 ↓ 3.1 142,333 1

Merge Full Join (cost=1,025,613.30..1,036,202.05 rows=46,636 width=120) (actual time=404.279..560.621 rows=142,333 loops=1)

  • Merge Cond: ((refined_monthly_imports.partner_code = refined_monthly_exports.reporter_code) AND (refined_monthly_imports.commodity_code = refined_monthly_exports.commodity_code) AND (refined_monthly_imports.agg
  • Filter: (GREATEST((refined_monthly_imports.refined_value)::double precision, (refined_monthly_exports.refined_value)::double precision) > '0'::double precision)
2. 56.415 85.951 ↓ 1.0 142,333 1

Sort (cost=510,387.29..510,733.75 rows=138,583 width=27) (actual time=79.289..85.951 rows=142,333 loops=1)

  • Sort Key: refined_monthly_imports.partner_code, refined_monthly_imports.commodity_code, refined_monthly_imports.aggregate_level, refined_monthly_imports.year
  • Sort Method: quicksort Memory: 17264kB
3. 20.317 29.536 ↓ 1.0 142,333 1

Bitmap Heap Scan on refined_temp_1 refined_monthly_imports (cost=5,965.05..498,552.03 rows=138,583 width=27) (actual time=9.355..29.536 rows=142,333 loops=1)

  • Recheck Cond: ((period = '201010'::text) AND (reporter_code = 842) AND (trade_flow_code = 1) AND (aggregate_level <> 0) AND (partner_code <> reporter_code))
  • Heap Blocks: exact=1331
4. 9.219 9.219 ↓ 1.0 142,333 1

Bitmap Index Scan on temp_index_1 (cost=0.00..5,930.40 rows=138,583 width=0) (actual time=9.219..9.219 rows=142,333 loops=1)

  • Index Cond: ((period = '201010'::text) AND (reporter_code = 842))
5. 302.060 331.720 ↓ 1.0 142,010 1

Sort (cost=515,226.01..515,575.79 rows=139,909 width=27) (actual time=324.969..331.720 rows=142,010 loops=1)

  • Sort Key: refined_monthly_exports.reporter_code, refined_monthly_exports.commodity_code, refined_monthly_exports.aggregate_level, refined_monthly_exports.year
  • Sort Method: quicksort Memory: 17239kB
6. 20.490 29.660 ↓ 1.0 142,010 1

Bitmap Heap Scan on refined_temp_2 refined_monthly_exports (cost=6,018.64..503,267.90 rows=139,909 width=27) (actual time=9.320..29.660 rows=142,010 loops=1)

  • Recheck Cond: ((period = '201010'::text) AND (partner_code = 842) AND (trade_flow_code = 2) AND (aggregate_level <> 0) AND (partner_code <> reporter_code))
  • Heap Blocks: exact=1515
7. 9.170 9.170 ↓ 1.0 142,010 1

Bitmap Index Scan on temp_index_4 (cost=0.00..5,983.66 rows=139,909 width=0) (actual time=9.170..9.170 rows=142,010 loops=1)

  • Index Cond: ((period = '201010'::text) AND (partner_code = 842))
Planning time : 0.562 ms
Execution time : 567.279 ms