explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vEwG : Optimization for: Optimization for: plan #5Fhw; plan #fT3t

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.029 744.955 ↑ 4.0 249 1

Limit (cost=48,993.61..48,996.11 rows=1,000 width=198) (actual time=744.866..744.955 rows=249 loops=1)

  • Buffers: shared hit=125 read=31349
2. 0.644 744.926 ↑ 27.0 249 1

Sort (cost=48,993.61..49,010.44 rows=6,730 width=198) (actual time=744.865..744.926 rows=249 loops=1)

  • Sort Key: d0.last_changed_at DESC
  • Sort Method: quicksort Memory: 123kB
  • Buffers: shared hit=125 read=31349
3. 0.335 744.282 ↑ 27.0 249 1

Hash Join (cost=125.95..48,624.61 rows=6,730 width=198) (actual time=1.871..744.282 rows=249 loops=1)

  • Hash Cond: (d0.last_changed_by_user_aggregate_id = u1.aggregate_id)
  • Buffers: shared hit=125 read=31349
4. 188.397 742.169 ↑ 27.0 249 1

Hash Left Join (cost=11.04..48,400.35 rows=6,730 width=183) (actual time=0.065..742.169 rows=249 loops=1)

  • Hash Cond: (d0.aggregate_id = f2.damage_aggregate_id)
  • Filter: ((d0.creator_aggregate_id = '32ef45cb-b54a-4d29-bb92-aef88272eb57'::uuid) OR (f2.star_status = 1))
  • Rows Removed by Filter: 607653
  • Buffers: shared hit=69 read=31349
5. 553.752 553.752 ↑ 1.1 607,902 1

Seq Scan on damages d0 (cost=0.00..45,962.87 rows=646,736 width=195) (actual time=0.019..553.752 rows=607,902 loops=1)

  • 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: 223405
  • Buffers: shared hit=66 read=31349
6. 0.004 0.020 ↑ 100.0 1 1

Hash (cost=9.79..9.79 rows=100 width=20) (actual time=0.020..0.020 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=3
7. 0.001 0.016 ↑ 100.0 1 1

Subquery Scan on f2 (cost=0.28..9.79 rows=100 width=20) (actual time=0.014..0.016 rows=1 loops=1)

  • Buffers: shared hit=3
8. 0.015 0.015 ↑ 100.0 1 1

Index Scan using users_aggregate_id_index on users s (cost=0.28..8.79 rows=100 width=62) (actual time=0.013..0.015 rows=1 loops=1)

  • Index Cond: (aggregate_id = '32ef45cb-b54a-4d29-bb92-aef88272eb57'::uuid)
  • Buffers: shared hit=3
9. 1.023 1.778 ↑ 1.0 2,618 1

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

  • Buckets: 4096 Batches: 1 Memory Usage: 196kB
  • Buffers: shared hit=56
10. 0.755 0.755 ↑ 1.0 2,618 1

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

  • Buffers: shared hit=56