explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B3KV

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

Limit (cost=7,016.52..7,016.54 rows=10 width=286) (actual time=3.017..3.018 rows=10 loops=1)

2. 0.032 3.015 ↑ 34.0 10 1

Sort (cost=7,016.52..7,017.37 rows=340 width=286) (actual time=3.015..3.015 rows=10 loops=1)

  • Sort Key: uipriority.prioritisedscore DESC
  • Sort Method: top-N heapsort Memory: 27kB
3. 0.005 2.983 ↑ 8.7 39 1

Nested Loop (cost=13.56..7,009.17 rows=340 width=286) (actual time=0.188..2.983 rows=39 loops=1)

4. 0.095 2.939 ↑ 8.7 39 1

Nested Loop (cost=13.41..6,948.81 rows=340 width=254) (actual time=0.186..2.939 rows=39 loops=1)

  • Join Filter: (((insights.categoryid = c.categoryid) AND (c.categoryid = 82)) OR (c.parentid = 82))
  • Rows Removed by Join Filter: 561
5. 0.019 0.025 ↑ 1.0 1 1

Nested Loop (cost=0.00..3.60 rows=1 width=66) (actual time=0.016..0.025 rows=1 loops=1)

  • Join Filter: (c.parentid = c1.categoryid)
  • Rows Removed by Join Filter: 28
6. 0.006 0.006 ↑ 1.0 29 1

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

7. 0.000 0.000 ↑ 2.0 1 29

Materialize (cost=0.00..1.45 rows=2 width=16) (actual time=0.000..0.000 rows=1 loops=29)

8. 0.008 0.008 ↑ 2.0 1 1

Seq Scan on categories c (cost=0.00..1.44 rows=2 width=16) (actual time=0.006..0.008 rows=1 loops=1)

  • Filter: ((categoryid = 82) OR (parentid = 82))
  • Rows Removed by Filter: 28
9. 0.301 2.819 ↓ 1.0 600 1

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

10. 0.642 0.718 ↓ 1.0 600 1

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

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

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

  • Index Cond: (userid = 8975)
12. 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())
13. 0.039 0.039 ↑ 1.0 1 39

Index Scan using pk_sourcetypes_sourcetypeid on sourcetypes st (cost=0.15..0.17 rows=1 width=40) (actual time=0.001..0.001 rows=1 loops=39)

  • Index Cond: (sourcetypeid = insights.sourcetypeid)