explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hGNZ : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #5Fhw; plan #fT3t; plan #vEwG; plan #4UsR; plan #Tk6F

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.004 10.383 ↑ 1.0 31 1

Limit (cost=1,398.19..1,398.27 rows=31 width=194) (actual time=10.373..10.383 rows=31 loops=1)

  • Buffers: shared hit=582 read=493
2. 0.203 10.379 ↑ 8.5 31 1

Sort (cost=1,398.19..1,398.86 rows=265 width=194) (actual time=10.371..10.379 rows=31 loops=1)

  • Sort Key: d0.last_changed_at DESC
  • Sort Method: top-N heapsort Memory: 38kB
  • Buffers: shared hit=582 read=493
3. 0.184 10.176 ↑ 1.1 249 1

Hash Join (cost=125.95..1,390.30 rows=265 width=194) (actual time=5.458..10.176 rows=249 loops=1)

  • Hash Cond: (d0.last_changed_by_user_aggregate_id = u1.aggregate_id)
  • Buffers: shared hit=582 read=493
4. 4.741 6.785 ↑ 1.1 249 1

Bitmap Heap Scan on damages d0 (cost=11.05..1,271.76 rows=265 width=179) (actual time=2.230..6.785 rows=249 loops=1)

  • Recheck Cond: (creator_aggregate_id = '32ef45cb-b54a-4d29-bb92-aef88272eb57'::uuid)
  • Filter: ((((status)::text <> 'created'::text) OR (damage_identifier IS NOT NULL)) AND (((source)::text = 'dialogue'::text) OR ((source)::text = 'client'::text)))
  • Rows Removed by Filter: 1252
  • Heap Blocks: exact=1010
  • Buffers: shared hit=578 read=441
5. 2.044 2.044 ↓ 4.4 1,501 1

Bitmap Index Scan on damages_creator_aggregate_id_index (cost=0.00..10.98 rows=341 width=0) (actual time=2.044..2.044 rows=1,501 loops=1)

  • Index Cond: (creator_aggregate_id = '32ef45cb-b54a-4d29-bb92-aef88272eb57'::uuid)
  • Buffers: shared read=9
6. 0.945 3.207 ↑ 1.0 2,618 1

Hash (cost=82.18..82.18 rows=2,618 width=31) (actual time=3.207..3.207 rows=2,618 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 196kB
  • Buffers: shared hit=4 read=52
7. 2.262 2.262 ↑ 1.0 2,618 1

Seq Scan on users u1 (cost=0.00..82.18 rows=2,618 width=31) (actual time=0.266..2.262 rows=2,618 loops=1)

  • Buffers: shared hit=4 read=52