explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.005 152.872 ↑ 1.0 31 1

Limit (cost=1,407.14..1,407.22 rows=31 width=194) (actual time=152.855..152.872 rows=31 loops=1)

  • Buffers: shared hit=408 read=676
2. 0.636 152.867 ↑ 8.6 31 1

Sort (cost=1,407.14..1,407.81 rows=266 width=194) (actual time=152.853..152.867 rows=31 loops=1)

  • Sort Key: d0.last_changed_at DESC
  • Sort Method: top-N heapsort Memory: 38kB
  • Buffers: shared hit=408 read=676
3. 0.488 152.231 ↑ 1.1 249 1

Hash Join (cost=130.45..1,399.22 rows=266 width=194) (actual time=11.884..152.231 rows=249 loops=1)

  • Hash Cond: (d0.last_changed_by_user_aggregate_id = u1.aggregate_id)
  • Buffers: shared hit=405 read=676
4. 140.772 143.741 ↑ 1.1 249 1

Bitmap Heap Scan on damages d0 (cost=15.55..1,280.66 rows=266 width=179) (actual time=3.825..143.741 rows=249 loops=1)

  • Recheck Cond: ((creator_aggregate_id = '32ef45cb-b54a-4d29-bb92-aef88272eb57'::uuid) OR (aggregate_id = '5e43b968-f979-490f-bf4f-1fa7c168d184'::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=399 read=623
5. 0.004 2.969 ↓ 0.0 0 1

BitmapOr (cost=15.55..15.55 rows=342 width=0) (actual time=2.969..2.969 rows=0 loops=1)

  • Buffers: shared read=12
6. 2.176 2.176 ↓ 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.176..2.176 rows=1,501 loops=1)

  • Index Cond: (creator_aggregate_id = '32ef45cb-b54a-4d29-bb92-aef88272eb57'::uuid)
  • Buffers: shared read=9
7. 0.789 0.789 ↑ 1.0 1 1

Bitmap Index Scan on damages_aggregate_id_index (cost=0.00..4.43 rows=1 width=0) (actual time=0.789..0.789 rows=1 loops=1)

  • Index Cond: (aggregate_id = '5e43b968-f979-490f-bf4f-1fa7c168d184'::uuid)
  • Buffers: shared read=3
8. 1.246 8.002 ↑ 1.0 2,618 1

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

  • Buckets: 4096 Batches: 1 Memory Usage: 196kB
  • Buffers: shared hit=3 read=53
9. 6.756 6.756 ↑ 1.0 2,618 1

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

  • Buffers: shared hit=3 read=53