explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XqR3

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 430.405 ↑ 1.0 10 1

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

2. 0.054 430.402 ↑ 10,328.3 10 1

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

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

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

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

Nested Loop (cost=0.86..225,895.27 rows=103,283 width=312) (actual time=2.694..430.297 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. 44.307 83.757 ↑ 1.0 202,175 1

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

6. 0.005 0.033 ↑ 2.0 1 1

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

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

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

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

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

9. 0.007 0.007 ↑ 1.0 29 1

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

10. 39.417 39.417 ↑ 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..39.417 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.900 ms