explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zkX

Settings
# exclusive inclusive rows x rows loops node
1. 144.577 144.577 ↓ 7.0 7 1

CTE Scan on ranked_messages (cost=7,014.41..7,014.44 rows=1 width=48) (actual time=125.727..144.577 rows=7 loops=1)

  • Filter: (rn = 1)
  • Rows Removed by Filter: 40956
2.          

CTE ranked_messages

3. 38.980 133.122 ↓ 40,963.0 40,963 1

Sort (cost=7,014.41..7,014.41 rows=1 width=40) (actual time=125.708..133.122 rows=40,963 loops=1)

  • Sort Key: ciqestimatenumericdata.effectivedate DESC
  • Sort Method: external sort Disk: 2184kB
4. 17.274 94.142 ↓ 40,963.0 40,963 1

WindowAgg (cost=7,014.38..7,014.40 rows=1 width=40) (actual time=70.585..94.142 rows=40,963 loops=1)

5. 41.834 76.868 ↓ 40,963.0 40,963 1

Sort (cost=7,014.38..7,014.38 rows=1 width=20) (actual time=70.579..76.868 rows=40,963 loops=1)

  • Sort Key: ciqestimatenumericdata.dataitemid, ciqestimatenumericdata.effectivedate DESC
  • Sort Method: external sort Disk: 1192kB
6. 8.867 35.034 ↓ 40,963.0 40,963 1

Nested Loop (cost=1.70..7,014.37 rows=1 width=20) (actual time=4.224..35.034 rows=40,963 loops=1)

7. 0.085 4.215 ↓ 224.0 224 1

Nested Loop (cost=0.99..2,528.79 rows=1 width=4) (actual time=0.037..4.215 rows=224 loops=1)

8. 0.382 0.382 ↓ 3.7 937 1

Index Only Scan using ix_ciqestimateperiod_periodid_companyid on ciqestimateperiod (cost=0.43..342.48 rows=254 width=4) (actual time=0.023..0.382 rows=937 loops=1)

  • Index Cond: (companyid = 251349)
  • Heap Fetches: 629
9. 3.748 3.748 ↓ 0.0 0 937

Index Only Scan using ix_ciqestimateconsensus_multi_columns on ciqestimateconsensus (cost=0.56..8.60 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=937)

  • Index Cond: ((estimateperiodid = ciqestimateperiod.estimateperiodid) AND (tradingitemid = 2589895))
  • Heap Fetches: 224
10. 21.952 21.952 ↑ 4.0 183 224

Index Scan using ix_ciqestimatenumericdata_multi_col on ciqestimatenumericdata (cost=0.70..4,478.32 rows=726 width=24) (actual time=0.020..0.098 rows=183 loops=224)

  • Index Cond: ((estimateconsensusid = ciqestimateconsensus.estimateconsensusid) AND (dataitemid = ANY ('{100161,100165,100313,100314,100315,100316,100317}'::integer[])))
  • Filter: ((currencyid = 160) OR (currencyid IS NULL))