explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EylO

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 417.456 ↑ 1.0 10 1

Limit (cost=229,569.02..229,569.05 rows=10 width=308) (actual time=417.454..417.456 rows=10 loops=1)

2. 0.057 417.456 ↑ 10,328.3 10 1

Sort (cost=229,569.02..229,827.23 rows=103,283 width=308) (actual time=417.454..417.456 rows=10 loops=1)

  • Sort Key: uipriority.prioritisedscore DESC
  • Sort Method: top-N heapsort Memory: 27kB
3. 0.041 417.399 ↑ 2,648.3 39 1

Hash Join (cost=22.56..227,337.11 rows=103,283 width=308) (actual time=2.708..417.399 rows=39 loops=1)

  • Hash Cond: (insights.sourcetypeid = st.sourcetypeid)
4. 133.467 417.354 ↑ 2,648.3 39 1

Nested Loop (cost=0.86..225,895.27 rows=103,283 width=312) (actual time=2.696..417.354 rows=39 loops=1)

  • Join Filter: (((uipriority.userid = 8975) AND (insights.expirydate >= now()) AND (categories.categoryid = 82)) OR (categories.parentid = 82))
  • Rows Removed by Join Filter: 198313
5. 42.807 81.712 ↑ 1.0 202,175 1

Nested Loop (cost=0.43..120,457.25 rows=206,897 width=280) (actual time=0.029..81.712 rows=202,175 loops=1)

6. 0.005 0.030 ↑ 2.0 1 1

Nested Loop Left Join (cost=0.00..3.67 rows=2 width=108) (actual time=0.014..0.030 rows=1 loops=1)

  • Join Filter: (pc.categoryid = categories.parentid)
  • Rows Removed by Join Filter: 28
7. 0.011 0.011 ↑ 2.0 1 1

Seq Scan on categories (cost=0.00..1.44 rows=2 width=58) (actual time=0.008..0.011 rows=1 loops=1)

  • Filter: ((categoryid = 82) OR (parentid = 82))
  • Rows Removed by Filter: 28
8. 0.010 0.014 ↑ 1.0 29 1

Materialize (cost=0.00..1.44 rows=29 width=50) (actual time=0.003..0.014 rows=29 loops=1)

9. 0.004 0.004 ↑ 1.0 29 1

Seq Scan on categories pc (cost=0.00..1.29 rows=29 width=50) (actual time=0.001..0.004 rows=29 loops=1)

10. 38.875 38.875 ↑ 2.1 202,175 1

Index Scan using insights_categoryid_idx on insights (cost=0.43..55,941.08 rows=428,571 width=180) (actual time=0.012..38.875 rows=202,175 loops=1)

  • Index Cond: (categoryid = categories.categoryid)
11. 202.175 202.175 ↑ 1.0 1 202,175

Index Scan using userinsightpriority_insightid_idx on userinsightpriority uipriority (cost=0.43..0.49 rows=1 width=48) (actual time=0.001..0.001 rows=1 loops=202,175)

  • Index Cond: (insightid = insights.insightid)
12. 0.003 0.004 ↑ 520.0 1 1

Hash (cost=15.20..15.20 rows=520 width=40) (actual time=0.004..0.004 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.001 0.001 ↑ 520.0 1 1

Seq Scan on sourcetypes st (cost=0.00..15.20 rows=520 width=40) (actual time=0.001..0.001 rows=1 loops=1)

Planning time : 0.815 ms