explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WnMx

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

Nested Loop Left Join (cost=4.00..2,461.49 rows=1 width=243) (actual rows= loops=)

  • Join Filter: (rev.asofdate = (SubPlan 2))
2. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3.43..2,008.81 rows=1 width=221) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3.00..2,000.92 rows=1 width=217) (actual rows= loops=)

  • Join Filter: (esnd.estimatescaleid = est.estimatescaleid)
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3.00..1,998.79 rows=1 width=201) (actual rows= loops=)

  • Join Filter: (esnd.dataitemid = fm.dataitemid)
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3.00..1,981.32 rows=1 width=162) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.71..1,973.71 rows=1 width=116) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.01..1,129.81 rows=1 width=82) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.01..1,128.72 rows=1 width=73) (actual rows= loops=)

  • Join Filter: ((m.main_data_item_id = eps.dataitemid) OR ((m.data_item_type)::text <> 'eps'::text))
9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.01..1,127.19 rows=1 width=64) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.57..1,119.30 rows=1 width=64) (actual rows= loops=)

  • Join Filter: (eps.companyid = ep.companyid)
11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.16..1,111.42 rows=1 width=60) (actual rows= loops=)

  • Join Filter: (mm.companyid = ep.companyid)
12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.72..344.88 rows=97 width=30) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Index Scan using index_capiq_ticker_mappings_on_slug on capiq_ticker_mappings mm (cost=0.29..8.30 rows=1 width=22) (actual rows= loops=)

  • Index Cond: ((slug)::text = 'aapl'::text)
14. 0.000 0.000 ↓ 0.0

Index Scan using ciqestimateconsensus_tradingitemid_idx on ciqestimateconsensus ec (cost=0.43..335.61 rows=97 width=12) (actual rows= loops=)

  • Index Cond: (tradingitemid = mm.primarytradingitemid)
15. 0.000 0.000 ↓ 0.0

Index Scan using pk_ciqestimateperiod on ciqestimateperiod ep (cost=0.43..7.89 rows=1 width=34) (actual rows= loops=)

  • Index Cond: ((estimateperiodid = ec.estimateperiodid) AND (periodtypeid = 1))
  • Filter: (fiscalyear = 2018)
16. 0.000 0.000 ↓ 0.0

Index Scan using pk_ciqestimateprimaryearnings on ciqestimateprimaryearnings eps (cost=0.42..7.86 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (tradingitemid = ec.tradingitemid)
17. 0.000 0.000 ↓ 0.0

Index Scan using pk_ciqestimateperiodrelconst on ciqestimateperiodrelconst eprc (cost=0.43..7.89 rows=1 width=10) (actual rows= loops=)

  • Index Cond: ((estimateperiodid = ec.estimateperiodid) AND (periodtypeid = 1))
18. 0.000 0.000 ↓ 0.0

Seq Scan on capiq_data_item_mapping m (cost=0.00..1.35 rows=12 width=17) (actual rows= loops=)

  • Filter: ((data_item_type)::text = 'eps'::text)
19. 0.000 0.000 ↓ 0.0

Seq Scan on ciqestimateperiodtype ept (cost=0.00..1.09 rows=1 width=11) (actual rows= loops=)

  • Filter: (periodtypeid = 1)
20. 0.000 0.000 ↓ 0.0

Index Scan using pk_ciqestimatenumericdata on ciqestimatenumericdata esnd (cost=0.70..843.82 rows=8 width=34) (actual rows= loops=)

  • Index Cond: ((estimateconsensusid = ec.estimateconsensusid) AND (dataitemid = m.referenced_data_item_id))
  • Filter: (todate > now())
21. 0.000 0.000 ↓ 0.0

Index Scan using pk_ciqdataitem on ciqdataitem di (cost=0.29..7.60 rows=1 width=46) (actual rows= loops=)

  • Index Cond: (dataitemid = esnd.dataitemid)
22. 0.000 0.000 ↓ 0.0

Seq Scan on capiq_field_mapping fm (cost=0.00..17.08 rows=32 width=47) (actual rows= loops=)

  • Filter: ((datatype)::text = 'estimates'::text)
23. 0.000 0.000 ↓ 0.0

Seq Scan on ciqestimatescaletype est (cost=0.00..1.50 rows=50 width=20) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Index Scan using ciqexchangerate_currencyid_idx on ciqexchangerate cex (cost=0.43..7.89 rows=1 width=16) (actual rows= loops=)

  • Index Cond: ((currencyid = esnd.currencyid) AND (pricedate = date_trunc('day'::text, esnd.effectivedate)) AND (latestsnapflag = 1))
25. 0.000 0.000 ↓ 0.0

Index Scan using pk_ciqestimaterevisiondaily on ciqestimaterevisiondaily rev (cost=0.57..203.11 rows=94 width=22) (actual rows= loops=)

  • Index Cond: ((estimateconsensusid = ec.estimateconsensusid) AND (dataitemid = m.referenced_data_item_id) AND (estimaterevisiontypeid = 5))
26.          

SubPlan (forNested Loop Left Join)

27. 0.000 0.000 ↓ 0.0

Result (cost=2.63..2.64 rows=1 width=8) (actual rows= loops=)

28.          

Initplan (forResult)

29. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..2.63 rows=1 width=8) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Index Only Scan Backward using pk_ciqestimaterevisiondaily on ciqestimaterevisiondaily rev2 (cost=0.57..290.66 rows=141 width=8) (actual rows= loops=)

  • Index Cond: ((estimateconsensusid = ec.estimateconsensusid) AND (dataitemid = di.dataitemid) AND (asofdate IS NOT NULL) AND (estimaterevisiontypeid = rev.estimaterevisiontypeid))