explain.depesz.com

PostgreSQL's explain analyze made readable

Result: L9M : mtm_rates_deals

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.014 0.329 ↓ 0.0 0 1

Insert on mtm_rates_deals (cost=0.99..2.61 rows=1 width=169) (actual time=0.329..0.329 rows=0 loops=1)

2. 0.017 0.315 ↑ 1.0 1 1

Subquery Scan on *SELECT* (cost=0.99..2.61 rows=1 width=169) (actual time=0.314..0.315 rows=1 loops=1)

3. 0.001 0.298 ↑ 1.0 1 1

Limit (cost=0.99..2.58 rows=1 width=89) (actual time=0.298..0.298 rows=1 loops=1)

4. 0.062 0.297 ↑ 21,238,760.0 1 1

Nested Loop (cost=0.99..33,563,047.74 rows=21,238,760 width=89) (actual time=0.297..0.297 rows=1 loops=1)

5. 0.024 0.186 ↑ 710,764.0 49 1

Nested Loop (cost=0.56..5,490,853.50 rows=34,827,436 width=129) (actual time=0.141..0.186 rows=49 loops=1)

6. 0.048 0.123 ↑ 59,449.0 1 1

Nested Loop (cost=0.00..37,176.83 rows=59,449 width=76) (actual time=0.123..0.123 rows=1 loops=1)

  • Join Filter: (th.edc_id = ec.edc_id)
  • Rows Removed by Join Filter: 196
7. 0.009 0.009 ↑ 10,083.0 6 1

Seq Scan on trade_header th (cost=0.00..2,630.98 rows=60,498 width=16) (actual time=0.008..0.009 rows=6 loops=1)

8. 0.053 0.066 ↑ 1.2 33 6

Materialize (cost=0.00..1.59 rows=39 width=68) (actual time=0.001..0.011 rows=33 loops=6)

9. 0.013 0.013 ↑ 1.0 39 1

Seq Scan on edc_costs ec (cost=0.00..1.39 rows=39 width=68) (actual time=0.003..0.013 rows=39 loops=1)

10. 0.039 0.039 ↑ 35.6 49 1

Index Scan using deals_rates_trades_trade_header_id_start_date_is_weekday_he_ind on deals_rates_trades drt (cost=0.56..74.28 rows=1,746 width=57) (actual time=0.016..0.039 rows=49 loops=1)

  • Index Cond: (trade_header_id = th.id)
11. 0.049 0.049 ↓ 0.0 0 49

Index Scan using valuation_vectors_compressed_temp_pk on valuation_vectors_compressed_temp vvc (cost=0.43..0.79 rows=1 width=33) (actual time=0.001..0.001 rows=0 loops=49)

  • Index Cond: ((as_of_date = '2019-01-15'::date) AND (curve_id = th.curve_id) AND (forward_date = (to_char(drt.start_date, 'YYYY-MM-01'::text))::date) AND (forward_date >= '2019-02-01'::date) AND (is_weekday = drt.is_weekday) AND (he = drt.he))