explain.depesz.com

PostgreSQL's explain analyze made readable

Result: E5BO

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 417.361 ↑ 1.0 10 1

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

2. 0.064 417.360 ↑ 10,328.3 10 1

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

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

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

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

Nested Loop (cost=0.86..225,895.27 rows=103,283 width=312) (actual time=2.698..417.245 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. 43.545 82.757 ↑ 1.0 202,175 1

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

6. 0.009 0.034 ↑ 2.0 1 1

Nested Loop Left Join (cost=0.00..3.67 rows=2 width=108) (actual time=0.017..0.034 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.012 ↑ 1.0 29 1

Materialize (cost=0.00..1.44 rows=29 width=50) (actual time=0.003..0.012 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. 39.178 39.178 ↑ 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.178 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)

Planning time : 0.942 ms