explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MZj : Optimization for: Optimization for: plan #DvmL; plan #ktWN

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.010 0.430 ↓ 1.8 7 1

Limit (cost=79.51..79.52 rows=4 width=221) (actual time=0.415..0.430 rows=7 loops=1)

2. 0.030 0.420 ↓ 1.8 7 1

Sort (cost=79.51..79.52 rows=4 width=221) (actual time=0.413..0.420 rows=7 loops=1)

  • Sort Key: (1), r.create_txtime
  • Sort Method: quicksort Memory: 26kB
3. 0.021 0.390 ↓ 1.8 7 1

HashAggregate (cost=79.43..79.47 rows=4 width=221) (actual time=0.386..0.390 rows=7 loops=1)

  • Group Key: r.id, r.recipient_id, r.user_id, r.status, r.score, r.comment, r.create_txtime, r.user_role, r.operation_type_id, r.external_id, r.item_id, r.item_title, r.stage_id, r.is_use_stars, r.category_id, r.shop_id, (1)
4. 0.025 0.369 ↓ 1.8 7 1

Append (cost=0.00..79.26 rows=4 width=221) (actual time=0.266..0.369 rows=7 loops=1)

5. 0.290 0.290 ↓ 1.7 5 1

Seq Scan on reviews r (cost=0.00..62.58 rows=3 width=221) (actual time=0.264..0.290 rows=5 loops=1)

  • Filter: (((recipient_id = 121201089) AND (status = 1) AND (shop_id IS NULL) AND (stage_id IS NULL)) OR (stage_id = ANY ('{1,2}'::integer[])))
  • Rows Removed by Filter: 1228
6. 0.041 0.054 ↓ 2.0 2 1

Bitmap Heap Scan on reviews r_1 (cost=4.32..16.64 rows=1 width=221) (actual time=0.033..0.054 rows=2 loops=1)

  • Recheck Cond: ((recipient_id = 121201089) AND (status = 1))
  • Filter: ((shop_id IS NULL) AND (stage_id = ANY ('{3,4}'::integer[])))
  • Rows Removed by Filter: 5
  • Heap Blocks: exact=5
7. 0.013 0.013 ↓ 3.0 12 1

Bitmap Index Scan on reviews_recipientid_status_index (cost=0.00..4.32 rows=4 width=0) (actual time=0.013..0.013 rows=12 loops=1)

  • Index Cond: ((recipient_id = 121201089) AND (status = 1))