explain.depesz.com

PostgreSQL's explain analyze made readable

Result: e36L

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 416.404 ↑ 1.0 10 1

Limit (cost=228,534.54..228,534.56 rows=10 width=308) (actual time=416.402..416.404 rows=10 loops=1)

2. 0.059 416.402 ↑ 10,328.3 10 1

Sort (cost=228,534.54..228,792.74 rows=103,283 width=308) (actual time=416.401..416.402 rows=10 loops=1)

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

Hash Join (cost=22.56..226,302.63 rows=103,283 width=308) (actual time=2.708..416.343 rows=39 loops=1)

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

Nested Loop (cost=0.86..224,860.79 rows=103,283 width=312) (actual time=2.697..416.289 rows=39 loops=1)

  • Join Filter: (((uipriority.userid = 8975) AND (categories.categoryid = 82)) OR (categories.parentid = 82))
  • Rows Removed by Join Filter: 198313
5. 43.723 82.691 ↑ 1.0 202,175 1

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

6. 0.007 0.032 ↑ 2.0 1 1

Nested Loop Left Join (cost=0.00..3.67 rows=2 width=108) (actual time=0.016..0.032 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.009..0.011 rows=1 loops=1)

  • Filter: ((categoryid = 82) OR (parentid = 82))
  • Rows Removed by Filter: 28
8. 0.009 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.005 0.005 ↑ 1.0 29 1

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

10. 38.936 38.936 ↑ 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.936 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.002 0.005 ↑ 520.0 1 1

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

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

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