explain.depesz.com

PostgreSQL's explain analyze made readable

Result: z262

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

Merge Left Join (cost=533,684,938.20..554,686,583.08 rows=2,064,414,438 width=30) (actual rows= loops=)

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

Sort (cost=482,772,676.23..487,933,712.33 rows=2,064,414,438 width=22) (actual rows= loops=)

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

Merge Join (cost=45,224,115.11..78,702,661.13 rows=2,064,414,438 width=22) (actual rows= loops=)

  • Merge Cond: (own_fund_detail.factset_fund_id = own_fund_detail_1.factset_fund_id)
4. 0.000 0.000 ↓ 0.0

Sort (cost=44,672.09..44,751.61 rows=31,809 width=27) (actual rows= loops=)

  • Sort Key: own_fund_detail.factset_fund_id
5. 0.000 0.000 ↓ 0.0

Hash Join (cost=40,344.93..42,293.23 rows=31,809 width=27) (actual rows= loops=)

  • Hash Cond: (own_fund_detail.factset_fund_id = f.factset_fund_id)
6. 0.000 0.000 ↓ 0.0

Hash Join (cost=35,022.63..36,533.56 rows=31,809 width=18) (actual rows= loops=)

  • Hash Cond: (own_fund_detail.fsym_id = s.fsym_id)
7. 0.000 0.000 ↓ 0.0

Hash Join (cost=27,520.98..28,594.54 rows=31,809 width=27) (actual rows= loops=)

  • Hash Cond: (own_fund_detail.fsym_id = sar.fsym_id)
8. 0.000 0.000 ↓ 0.0

HashAggregate (cost=20,019.33..20,337.42 rows=31,809 width=18) (actual rows= loops=)

  • Group Key: own_fund_detail.fsym_id, own_fund_detail.factset_fund_id
9. 0.000 0.000 ↓ 0.0

Index Only Scan using own_fund_detail_pkey on own_fund_detail (cost=0.57..19,860.19 rows=31,828 width=18) (actual rows= loops=)

  • Index Cond: ((factset_fund_id IS NOT NULL) AND (factset_fund_id = ANY ('{04L2RZ-E,04L2RZ-E}'::bpchar[])))
10. 0.000 0.000 ↓ 0.0

Hash (cost=4,927.40..4,927.40 rows=205,940 width=9) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Seq Scan on own_sec_coverage sar (cost=0.00..4,927.40 rows=205,940 width=9) (actual rows= loops=)

  • Filter: (fsym_id IS NOT NULL)
12. 0.000 0.000 ↓ 0.0

Hash (cost=4,927.40..4,927.40 rows=205,940 width=9) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Seq Scan on own_sec_coverage s (cost=0.00..4,927.40 rows=205,940 width=9) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Hash (cost=3,824.91..3,824.91 rows=119,791 width=9) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Seq Scan on own_ent_funds f (cost=0.00..3,824.91 rows=119,791 width=9) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Materialize (cost=45,179,443.02..47,724,063.59 rows=12,980,065 width=13) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Unique (cost=45,179,443.02..47,561,812.78 rows=12,980,065 width=21) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Sort (cost=45,179,443.02..45,775,035.46 rows=238,236,976 width=21) (actual rows= loops=)

  • Sort 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))
19. 0.000 0.000 ↓ 0.0

Seq Scan on own_fund_detail own_fund_detail_1 (cost=0.00..7,145,642.08 rows=238,236,976 width=21) (actual rows= loops=)

  • Filter: (report_date IS NOT NULL)
20. 0.000 0.000 ↓ 0.0

Materialize (cost=50,912,261.97..51,031,380.46 rows=23,823,698 width=30) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Sort (cost=50,912,261.97..50,971,821.21 rows=23,823,698 width=30) (actual rows= loops=)

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

Subquery Scan on adjh (cost=44,206,954.70..47,423,153.88 rows=23,823,698 width=30) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Unique (cost=44,206,954.70..47,184,916.90 rows=23,823,698 width=30) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Sort (cost=44,206,954.70..44,802,547.14 rows=238,236,976 width=30) (actual rows= loops=)

  • Sort 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
25. 0.000 0.000 ↓ 0.0

Seq Scan on own_fund_detail own_fund_detail_2 (cost=0.00..5,358,864.76 rows=238,236,976 width=30) (actual rows= loops=)