explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.006 735.109 ↑ 1.0 31 1

Limit (cost=52,861.73..52,861.80 rows=31 width=194) (actual time=735.087..735.109 rows=31 loops=1)

  • Buffers: shared hit=14755 read=16693
2. 0.294 735.103 ↑ 12.7 31 1

Sort (cost=52,861.73..52,862.71 rows=394 width=194) (actual time=735.086..735.103 rows=31 loops=1)

  • Sort Key: d0.last_changed_at DESC
  • Sort Method: top-N heapsort Memory: 44kB
  • Buffers: shared hit=14755 read=16693
3. 133.167 734.809 ↑ 3.9 100 1

Hash Join (cost=65.03..52,850.00 rows=394 width=194) (actual time=9.289..734.809 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 (lower((d0.damage_identifier)::text) ~~ '%test%'::text))
  • Rows Removed by Join Filter: 12040
  • Buffers: shared hit=14755 read=16693
4. 601.530 601.530 ↑ 1.1 607,902 1

Seq Scan on damages d0 (cost=0.00..50,119.47 rows=646,285 width=179) (actual time=0.008..601.530 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=14722 read=16693
5. 0.026 0.112 ↑ 1.0 56 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
  • Buffers: shared hit=33
6. 0.060 0.086 ↑ 1.0 56 1

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

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

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