explain.depesz.com

PostgreSQL's explain analyze made readable

Result: auss : Optimization for: Optimization for: Optimization for: Optimization for: plan #DvmL; plan #ktWN; plan #MZj; plan #7w9C

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.025 0.472 ↓ 1.8 7 1

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

2. 0.027 0.447 ↓ 1.8 7 1

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

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

HashAggregate (cost=79.43..79.47 rows=4 width=221) (actual time=0.414..0.420 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.018 0.396 ↓ 1.8 7 1

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

5. 0.354 0.354 ↓ 1.7 5 1

Seq Scan on reviews r (cost=0.00..62.58 rows=3 width=221) (actual time=0.328..0.354 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.011 0.024 ↓ 2.0 2 1

Bitmap Heap Scan on reviews r_1 (cost=4.32..16.64 rows=1 width=221) (actual time=0.022..0.024 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=3
7. 0.013 0.013 ↓ 1.8 7 1

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

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