explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8BNV : Optimization for: plan #Puow

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.007 915.909 ↑ 1.0 31 1

Limit (cost=52,827.17..52,827.24 rows=31 width=194) (actual time=915.895..915.909 rows=31 loops=1)

  • Buffers: shared hit=15731 read=15720
2. 0.331 915.902 ↑ 12.7 31 1

Sort (cost=52,827.17..52,828.15 rows=394 width=194) (actual time=915.894..915.902 rows=31 loops=1)

  • Sort Key: d0.last_changed_at DESC
  • Sort Method: top-N heapsort Memory: 44kB
  • Buffers: shared hit=15731 read=15720
3. 168.030 915.571 ↑ 3.9 100 1

Hash Join (cost=65.03..52,815.44 rows=394 width=194) (actual time=6.392..915.571 rows=100 loops=1)

  • Hash Cond: (d0.last_changed_by_user_aggregate_id = u1.aggregate_id)
  • Join Filter: (((u1.full_name)::text ~~* '%test%'::text) OR ((d0.damage_identifier)::text ~~* '%test%'::text))
  • Rows Removed by Join Filter: 12040
  • Buffers: shared hit=15731 read=15720
4. 746.496 746.496 ↑ 1.1 607,902 1

Seq Scan on damages d0 (cost=0.00..50,119.47 rows=646,285 width=179) (actual time=0.019..746.496 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)) AND (((source)::text = 'dialogue'::text) OR ((source)::text = 'client'::text)))
  • Rows Removed by Filter: 223408
  • Buffers: shared hit=15699 read=15716
5. 0.034 1.045 ↑ 1.0 56 1

Hash (cost=64.33..64.33 rows=56 width=31) (actual time=1.045..1.045 rows=56 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
  • Buffers: shared hit=29 read=4
6. 0.301 1.011 ↑ 1.0 56 1

Bitmap Heap Scan on users u1 (cost=4.71..64.33 rows=56 width=31) (actual time=0.719..1.011 rows=56 loops=1)

  • Recheck Cond: (company_aggregate_id = '7b0caaa5-91db-47d1-81b4-d7441e125de0'::uuid)
  • Heap Blocks: exact=31
  • Buffers: shared hit=29 read=4
7. 0.710 0.710 ↓ 1.0 58 1

Bitmap Index Scan on users_company_aggregate_id_index (cost=0.00..4.70 rows=56 width=0) (actual time=0.710..0.710 rows=58 loops=1)

  • Index Cond: (company_aggregate_id = '7b0caaa5-91db-47d1-81b4-d7441e125de0'::uuid)
  • Buffers: shared read=2