explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ij1U

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

Limit (cost=7,006.66..7,006.69 rows=10 width=308) (actual time=3.575..3.577 rows=10 loops=1)

2. 0.036 3.576 ↑ 61.7 10 1

Sort (cost=7,006.66..7,008.20 rows=617 width=308) (actual time=3.575..3.576 rows=10 loops=1)

  • Sort Key: uipriority.prioritisedscore DESC
  • Sort Method: top-N heapsort Memory: 27kB
3. 0.087 3.540 ↑ 15.8 39 1

Nested Loop (cost=35.11..6,993.33 rows=617 width=308) (actual time=0.227..3.540 rows=39 loops=1)

  • Join Filter: (((insights.categoryid = categories.categoryid) AND (categories.categoryid = 82)) OR (categories.parentid = 82))
  • Rows Removed by Join Filter: 561
4. 0.013 0.034 ↑ 2.0 1 1

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

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

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

  • Filter: ((categoryid = 82) OR (parentid = 82))
  • Rows Removed by Filter: 28
6. 0.004 0.007 ↑ 1.0 29 1

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

7. 0.003 0.003 ↑ 1.0 29 1

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

8. 0.268 3.419 ↓ 1.0 600 1

Materialize (cost=35.11..6,967.65 rows=587 width=244) (actual time=0.181..3.419 rows=600 loops=1)

9. 0.162 3.151 ↓ 1.0 600 1

Hash Join (cost=35.11..6,964.71 rows=587 width=244) (actual time=0.177..3.151 rows=600 loops=1)

  • Hash Cond: (insights.sourcetypeid = st.sourcetypeid)
10. 0.449 2.983 ↓ 1.0 600 1

Nested Loop (cost=13.41..6,934.94 rows=587 width=212) (actual time=0.164..2.983 rows=600 loops=1)

11. 0.654 0.734 ↓ 1.0 600 1

Bitmap Heap Scan on userinsightpriority uipriority (cost=12.98..2,055.45 rows=587 width=40) (actual time=0.152..0.734 rows=600 loops=1)

  • Recheck Cond: (userid = 8975)
  • Heap Blocks: exact=600
12. 0.080 0.080 ↓ 1.0 600 1

Bitmap Index Scan on userinsightpriority_userid_idx (cost=0.00..12.83 rows=587 width=0) (actual time=0.080..0.080 rows=600 loops=1)

  • Index Cond: (userid = 8975)
13. 1.800 1.800 ↑ 1.0 1 600

Index Scan using pk_insights_insightid on insights (cost=0.43..8.30 rows=1 width=180) (actual time=0.003..0.003 rows=1 loops=600)

  • Index Cond: (insightid = uipriority.insightid)
  • Filter: (expirydate >= now())
14. 0.004 0.006 ↑ 520.0 1 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.002 0.002 ↑ 520.0 1 1

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

Planning time : 0.738 ms