explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cPCT : Optimization for: Optimization for: plan #Puow; plan #8BNV

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.003 703.221 ↑ 1.0 31 1

Limit (cost=52,819.22..52,819.30 rows=31 width=194) (actual time=703.210..703.221 rows=31 loops=1)

  • Buffers: shared hit=14704 read=16744
2. 0.229 703.218 ↑ 4.1 31 1

Sort (cost=52,819.22..52,819.54 rows=127 width=194) (actual time=703.210..703.218 rows=31 loops=1)

  • Sort Key: d0.last_changed_at DESC
  • Sort Method: top-N heapsort Memory: 42kB
  • Buffers: shared hit=14704 read=16744
3. 119.790 702.989 ↑ 1.6 79 1

Hash Join (cost=65.03..52,815.44 rows=127 width=194) (actual time=8.626..702.989 rows=79 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: 12061
  • Buffers: shared hit=14704 read=16744
4. 582.601 582.601 ↑ 1.1 607,902 1

Seq Scan on damages d0 (cost=0.00..50,119.47 rows=646,285 width=179) (actual time=0.010..582.601 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=14702 read=16713
5. 0.036 0.598 ↑ 1.0 56 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
  • Buffers: shared hit=2 read=31
6. 0.519 0.562 ↑ 1.0 56 1

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

  • Recheck Cond: (company_aggregate_id = '7b0caaa5-91db-47d1-81b4-d7441e125de0'::uuid)
  • Heap Blocks: exact=31
  • Buffers: shared hit=2 read=31
7. 0.043 0.043 ↓ 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.043..0.043 rows=58 loops=1)

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