explain.depesz.com

PostgreSQL's explain analyze made readable

Result: taVi

Settings
# exclusive inclusive rows x rows loops node
1. 1.382 482.068 ↓ 2,497.0 2,497 1

Unique (cost=18,170.13..18,170.17 rows=1 width=608) (actual time=480.474..482.068 rows=2,497 loops=1)

2. 4.490 480.686 ↓ 3,372.0 3,372 1

Sort (cost=18,170.13..18,170.14 rows=1 width=608) (actual time=480.473..480.686 rows=3,372 loops=1)

  • Sort Key: r.companyname, r.company_id, r.ticker, r.yes_votes, r.no_votes, r.abstain_votes, r.shareholdermeetingdate, r.revenues, r.assets, r.marketcap, r.shares_out_fy, r.shareholder_proposals_id, (count(r.companyname) OVER (?))
  • Sort Method: quicksort Memory: 953kB
3. 2.678 476.196 ↓ 3,372.0 3,372 1

WindowAgg (cost=18,170.06..18,170.12 rows=1 width=608) (actual time=475.003..476.196 rows=3,372 loops=1)

4. 1.337 473.518 ↓ 3,372.0 3,372 1

Unique (cost=18,170.06..18,170.10 rows=1 width=608) (actual time=471.875..473.518 rows=3,372 loops=1)

5. 12.383 472.181 ↓ 3,372.0 3,372 1

Sort (cost=18,170.06..18,170.07 rows=1 width=608) (actual time=471.873..472.181 rows=3,372 loops=1)

  • Sort Key: r.companyname, r.company_id, r.ticker, r.yes_votes, r.no_votes, r.abstain_votes, r.shareholdermeetingdate, r.revenues, r.assets, r.marketcap, r.shares_out_fy, r.sector_id, r.shareholder_proposals_id
  • Sort Method: quicksort Memory: 953kB
6. 1.027 459.798 ↓ 3,372.0 3,372 1

Subquery Scan on r (cost=18,170.00..18,170.05 rows=1 width=608) (actual time=456.772..459.798 rows=3,372 loops=1)

  • Filter: (r.rank = 1)
  • Rows Removed by Filter: 15
7. 1.569 458.771 ↓ 3,387.0 3,387 1

Unique (cost=18,170.00..18,170.04 rows=1 width=644) (actual time=456.764..458.771 rows=3,387 loops=1)

8. 10.095 457.202 ↓ 3,387.0 3,387 1

Sort (cost=18,170.00..18,170.00 rows=1 width=644) (actual time=456.762..457.202 rows=3,387 loops=1)

  • Sort Key: (CASE COALESCE((fin.share_holder_meeting_date)::timestamp with time zone, to_timestamp('01/01/0001'::text, 'mm/dd/yyyy'::text)) WHEN to_timestamp('01/01/0001'::text, 'mm/dd/yyyy'::text) THEN COALESCE((s.submission_date)::timestamp with time zone, to_timestamp('01/01/0001'::text, 'mm/dd/yyyy'::text)) ELSE (fin.share_holder_meeting_date)::timestamp with time zone END) DESC NULLS LAST, (rank() OVER (?)), fin.fy_order, (COALESCE(mc.aka_co_name, mc.company_name)), mc.ticker, (CASE COALESCE(sp.yes_votes, '0'::bigint) WHEN '-999999999'::integer THEN '0'::bigint ELSE sp.yes_votes END), (CASE COALESCE(sp.no_votes, '0'::bigint) WHEN '-999999999'::integer THEN '0'::bigint ELSE sp.no_votes END), (CASE COALESCE(sp.abstain_votes, '0'::bigint) WHEN '-999999999'::integer THEN '0'::bigint ELSE sp.abstain_votes END), mc.company_id, mcs.sector_id, fin.revenues, fin.total_assets, finc.market_cap_fy, (COALESCE(fin.sh_out, '-999999999'::bigint)), sp.shareholder_proposals_id
  • Sort Method: quicksort Memory: 996kB
9. 8.663 447.107 ↓ 3,387.0 3,387 1

WindowAgg (cost=18,169.94..18,169.99 rows=1 width=644) (actual time=437.871..447.107 rows=3,387 loops=1)

10. 5.846 438.444 ↓ 3,387.0 3,387 1

Sort (cost=18,169.94..18,169.94 rows=1 width=162) (actual time=437.843..438.444 rows=3,387 loops=1)

  • Sort Key: fin.company_id, fin.share_holder_meeting_date DESC, s.submission_date DESC NULLS LAST
  • Sort Method: quicksort Memory: 996kB
11. 121.122 432.598 ↓ 3,387.0 3,387 1

Nested Loop Left Join (cost=5,236.88..18,169.93 rows=1 width=162) (actual time=47.338..432.598 rows=3,387 loops=1)

  • Filter: (CASE COALESCE((fin.share_holder_meeting_date)::timestamp with time zone, to_timestamp('01/01/0001'::text, 'mm/dd/yyyy'::text)) WHEN to_timestamp('01/01/0001'::text, 'mm/dd/yyyy'::text) THEN COALESCE((s.submission_date)::timestamp with time zone, to_timestamp('01/01/0001'::text, 'mm/dd/yyyy'::text)) ELSE (fin.share_holder_meeting_date)::timestamp with time zone END >= (to_timestamp(((CURRENT_DATE - '1 year'::interval))::text, 'YYYY-MM-DD HH24:MI:SS'::text))::timestamp without time zone)
  • Rows Removed by Filter: 29747
12. 9.724 278.342 ↓ 33,134.0 33,134 1

Nested Loop Left Join (cost=5,236.60..18,169.55 rows=1 width=154) (actual time=47.240..278.342 rows=33,134 loops=1)

13. 12.761 197.014 ↓ 23,868.0 23,868 1

Nested Loop (cost=5,236.31..18,169.22 rows=1 width=146) (actual time=47.216..197.014 rows=23,868 loops=1)

14. 0.000 88.781 ↓ 23,868.0 23,868 1

Gather (cost=5,235.89..18,168.57 rows=1 width=154) (actual time=47.189..88.781 rows=23,868 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
15. 161.212 282.721 ↓ 7,956.0 7,956 3

Nested Loop (cost=4,235.89..17,168.47 rows=1 width=154) (actual time=37.400..282.721 rows=7,956 loops=3)

  • Join Filter: ((sp.company_id = fin.company_id) AND (sp.fiscal_year_id = fin.fiscal_year_id))
  • Rows Removed by Join Filter: 24937
16. 14.974 121.492 ↓ 5.6 7,971 3

Parallel Hash Join (cost=4,235.48..15,880.83 rows=1,429 width=111) (actual time=37.271..121.492 rows=7,971 loops=3)

  • Hash Cond: (sp.company_id = mc.company_id)
17. 69.954 69.954 ↓ 5.6 7,971 3

Parallel Seq Scan on shareholder_proposals sp (cost=0.00..11,641.60 rows=1,429 width=48) (actual time=0.053..69.954 rows=7,971 loops=3)

  • Filter: ((sub_category = 7) AND (sh_proposal_type = 9) AND (((CASE COALESCE(yes_votes, '0'::bigint) WHEN '-999999999'::integer THEN '0'::bigint ELSE COALESCE(yes_votes, '0'::bigint) END + CASE COALESCE(no_votes, '0'::bigint) WHEN '-999999999'::integer THEN '0'::bigint ELSE COALESCE(no_votes, '0'::bigint) END) + CASE COALESCE(abstain_votes, '0'::bigint) WHEN '-999999999'::integer THEN '0'::bigint ELSE COALESCE(abstain_votes, '0'::bigint) END) <> 0))
  • Rows Removed by Filter: 113031
18. 20.260 36.564 ↑ 1.8 40,056 3

Parallel Hash (cost=3,351.88..3,351.88 rows=70,688 width=63) (actual time=36.563..36.564 rows=40,056 loops=3)

  • Buckets: 131072 Batches: 1 Memory Usage: 10016kB
19. 16.304 16.304 ↑ 1.8 40,056 3

Parallel Seq Scan on master_company mc (cost=0.00..3,351.88 rows=70,688 width=63) (actual time=0.034..16.304 rows=40,056 loops=3)

20. 0.017 0.017 ↑ 1.2 4 23,914

Index Scan using financial_idx1 on financial fin (cost=0.42..0.83 rows=5 width=51) (actual time=0.007..0.017 rows=4 loops=23,914)

  • Index Cond: (company_id = mc.company_id)
21. 95.472 95.472 ↑ 1.0 1 23,868

Index Scan using financial_calc_pkey on financial_calc finc (cost=0.42..0.65 rows=1 width=16) (actual time=0.004..0.004 rows=1 loops=23,868)

  • Index Cond: (fiscal_year_id = fin.fiscal_year_id)
22. 71.604 71.604 ↑ 1.0 1 23,868

Index Scan using master_company_sector_idx1 on master_company_sector mcs (cost=0.29..0.32 rows=1 width=16) (actual time=0.002..0.003 rows=1 loops=23,868)

  • Index Cond: (company_id = mc.company_id)
23. 33.134 33.134 ↓ 0.0 0 33,134

Index Scan using sop_sub_date_idx on sop_sub_date s (cost=0.28..0.33 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=33,134)

  • Index Cond: (sp.shareholder_proposals_id = shareholder_proposals_id)