explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 78S : Simplified query

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 2.131 ↑ 1.0 11 1

Limit (cost=0.86..352.29 rows=11 width=8) (actual time=0.209..2.131 rows=11 loops=1)

  • Output: review.id, review.product_id
  • Buffers: shared hit=3125
2. 0.012 2.129 ↑ 5,471.3 11 1

Nested Loop Semi Join (cost=0.86..1,922,751.63 rows=60,184 width=8) (actual time=0.208..2.129 rows=11 loops=1)

  • Output: review.id, review.product_id
  • Buffers: shared hit=3125
3. 0.047 0.047 ↑ 7,246.4 207 1

Index Scan Backward using review_pkey on stuff.review (cost=0.43..15,253.43 rows=1,500,000 width=8) (actual time=0.009..0.047 rows=207 loops=1)

  • Output: review.id, review.product_id
  • Buffers: shared hit=7
4. 0.210 2.070 ↓ 0.0 0 207

Nested Loop (cost=0.44..1.27 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=207)

  • Output: pc.product_id
  • Inner Unique: true
  • Buffers: shared hit=3118
5. 0.621 0.621 ↑ 1.0 6 207

Index Only Scan using category_to_product_pkey on stuff.category_to_product pc (cost=0.29..0.33 rows=6 width=8) (actual time=0.002..0.003 rows=6 loops=207)

  • Output: pc.product_id, pc.category_id
  • Index Cond: (pc.product_id = review.product_id)
  • Heap Fetches: 1239
  • Buffers: shared hit=640
6. 1.239 1.239 ↓ 0.0 0 1,239

Index Scan using category_pkey on stuff.category c (cost=0.14..0.16 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1,239)

  • Output: c.id, c.parent_id
  • Index Cond: (c.id = pc.category_id)
  • Filter: ((27 = c.id) OR (27 = c.parent_id))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=2478