explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vxx9 : Optimization for: plan #3OTd

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 2,348.420 59,795.282 ↑ 6.5 668,260 1

Unique (cost=1,951,399.80..2,027,675.18 rows=4,358,593 width=99) (actual time=52,375.639..59,795.282 rows=668,260 loops=1)

  • Functions: 24
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 3.045 ms, Inlining 9.827 ms, Optimization 201.759 ms, Emission 126.606 ms, Total 341.238 ms
2. 35,160.117 57,446.862 ↓ 1.7 7,271,650 1

Sort (cost=1,951,399.80..1,962,296.28 rows=4,358,593 width=99) (actual time=52,375.638..57,446.862 rows=7,271,650 loops=1)

  • Sort Key: bins.series, bins.span_name, bins.work_unit_type, (((((((bins.series - 1))::numeric * 0.1))::text || '-'::text) || (((bins.series)::numeric * 0.1))::text)), (COALESCE(t.bincount, '0'::bigint)), c.cost_per_tree
  • Sort Method: external merge Disk: 633,056kB
3. 7,983.105 22,286.745 ↓ 1.7 7,271,650 1

Merge Right Join (cost=1.40..994,018.56 rows=4,358,593 width=99) (actual time=338.624..22,286.745 rows=7,271,650 loops=1)

  • Merge Cond: ((t.span_name = bins.span_name) AND (t.work_unit_type = bins.work_unit_type) AND (t.dist = bins.series))
4. 67.498 67.498 ↑ 1.0 180,871 1

Index Scan using span_bin_count_view_idx on span_bin_count_view t (cost=0.42..14,730.98 rows=180,871 width=61) (actual time=0.007..67.498 rows=180,871 loops=1)

5. 2,390.983 14,236.142 ↓ 1.7 7,271,650 1

Materialize (cost=0.97..812,925.95 rows=4,358,593 width=59) (actual time=0.043..14,236.142 rows=7,271,650 loops=1)

6. 3,851.711 11,845.159 ↓ 1.7 7,271,650 1

Merge Join (cost=0.97..802,029.47 rows=4,358,593 width=59) (actual time=0.039..11,845.159 rows=7,271,650 loops=1)

  • Merge Cond: ((bins.span_name = c.span_name) AND (bins.work_unit_type = c.work_unit_type))
7. 7,362.749 7,362.749 ↑ 1.0 7,271,650 1

Index Only Scan using span_series_view_idx_2 on span_series_view bins (cost=0.56..683,765.47 rows=7,271,650 width=53) (actual time=0.022..7,362.749 rows=7,271,650 loops=1)

  • Heap Fetches: 7,271,650
8. 601.285 630.699 ↓ 108.8 7,271,641 1

Materialize (cost=0.42..5,797.44 rows=66,826 width=55) (actual time=0.009..630.699 rows=7,271,641 loops=1)

9. 29.414 29.414 ↑ 1.0 66,826 1

Index Scan using span_tree_cost_view_idx on span_tree_cost_view c (cost=0.42..5,630.37 rows=66,826 width=55) (actual time=0.008..29.414 rows=66,826 loops=1)

Execution time : 59,886.676 ms