explain.depesz.com

PostgreSQL's explain analyze made readable

Result: elHX

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=43,742,255.31..45,641,954.85 rows=253,032,645 width=30) (actual rows= loops=)

  • Merge Cond: ((own_fund_detail_1.report_date = adjh.report_date) AND (sar.fsym_id = adjh.fsym_id))
  • Join Filter: (adjh.factset_fund_id = own_fund_detail.factset_fund_id)
2. 0.000 0.000 ↓ 0.0

Sort (cost=43,709,102.80..44,341,684.41 rows=253,032,645 width=22) (actual rows= loops=)

  • Sort Key: own_fund_detail_1.report_date DESC, sar.fsym_id
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10,196.70..3,203,240.83 rows=253,032,645 width=22) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.41..29,493.27 rows=15,909 width=18) (actual rows= loops=)

  • Join Filter: (own_fund_detail.fsym_id = sar.fsym_id)
5. 0.000 0.000 ↓ 0.0

Merge Join (cost=0.99..21,180.49 rows=15,909 width=27) (actual rows= loops=)

  • Merge Cond: (own_fund_detail.fsym_id = s.fsym_id)
6. 0.000 0.000 ↓ 0.0

Unique (cost=0.57..9,995.95 rows=15,909 width=18) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Index Only Scan using own_fund_detail_pkey on own_fund_detail (cost=0.57..9,956.16 rows=15,914 width=18) (actual rows= loops=)

  • Index Cond: ((factset_fund_id IS NOT NULL) AND (factset_fund_id = '04L2RZ-E'::bpchar))
8. 0.000 0.000 ↓ 0.0

Index Only Scan using own_sec_coverage_fsym_id_idx on own_sec_coverage s (cost=0.42..10,311.74 rows=205,940 width=9) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Index Only Scan using own_sec_coverage_fsym_id_idx on own_sec_coverage sar (cost=0.42..0.51 rows=1 width=9) (actual rows= loops=)

  • Index Cond: ((fsym_id = s.fsym_id) AND (fsym_id IS NOT NULL))
10. 0.000 0.000 ↓ 0.0

Materialize (cost=10,195.29..10,879.27 rows=15,905 width=22) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10,195.29..10,799.74 rows=15,905 width=22) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Index Only Scan using own_ent_funds_factset_fund_id_current_report_date_active_flag_i on own_ent_funds f (cost=0.42..8.44 rows=1 width=9) (actual rows= loops=)

  • Index Cond: (factset_fund_id = '04L2RZ-E'::bpchar)
13. 0.000 0.000 ↓ 0.0

HashAggregate (cost=10,194.87..10,473.21 rows=15,905 width=21) (actual rows= loops=)

  • Group Key: own_fund_detail_1.factset_fund_id, own_fund_detail_1.report_date, (date_trunc('day'::text, (own_fund_detail_1.report_date)::timestamp with time zone) - '540 days'::interval)
14. 0.000 0.000 ↓ 0.0

Index Only Scan using own_fund_detail_pkey on own_fund_detail own_fund_detail_1 (cost=0.57..10,075.52 rows=15,914 width=21) (actual rows= loops=)

  • Index Cond: ((factset_fund_id = '04L2RZ-E'::bpchar) AND (report_date IS NOT NULL))
15. 0.000 0.000 ↓ 0.0

Sort (cost=33,152.51..33,192.29 rows=15,909 width=30) (actual rows= loops=)

  • Sort Key: adjh.report_date DESC, adjh.fsym_id
16. 0.000 0.000 ↓ 0.0

Subquery Scan on adjh (cost=31,724.08..32,042.26 rows=15,909 width=30) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

HashAggregate (cost=31,724.08..31,883.17 rows=15,909 width=30) (actual rows= loops=)

  • Group Key: own_fund_detail_2.factset_fund_id, own_fund_detail_2.fsym_id, own_fund_detail_2.reported_holding, own_fund_detail_2.report_date
18. 0.000 0.000 ↓ 0.0

Index Scan using own_fund_detail_pkey on own_fund_detail own_fund_detail_2 (cost=0.57..31,564.94 rows=15,914 width=30) (actual rows= loops=)

  • Index Cond: (factset_fund_id = '04L2RZ-E'::bpchar)