explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uvny

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 636.391 ↑ 1.0 1 1

Aggregate (cost=14,116.49..14,116.50 rows=1 width=8) (actual time=636.390..636.391 rows=1 loops=1)

2. 284.837 636.386 ↓ 0.0 0 1

Function Scan on opportunity_processed opportunity_procedure (cost=5,636.48..14,116.48 rows=4 width=0) (actual time=636.386..636.386 rows=0 loops=1)

  • Filter: ((deleted_at IS NULL) AND ((SubPlan 1) OR COALESCE((lower(unaccent(observation)) ~~ lower(unaccent('%ALVARO%'::text))), false) OR ((hashed SubPlan 2) AND (owned_by = 284))))
  • Rows Removed by Filter: 186
3.          

SubPlan (for Function Scan)

4. 0.744 0.744 ↓ 0.0 0 186

Index Scan using person_person_id_uindex on person (cost=0.42..8.45 rows=1 width=0) (actual time=0.004..0.004 rows=0 loops=186)

  • Index Cond: (person_id = opportunity_procedure.person_id)
  • Filter: ((deleted_at IS NULL) AND (system_id = 11) AND COALESCE((lower(unaccent(name)) ~~ lower(unaccent('%ALVARO%'::text))), false))
  • Rows Removed by Filter: 1
5. 350.805 350.805 ↑ 9,645.3 3 1

Seq Scan on opportunity_timeline (cost=0.00..5,563.89 rows=28,936 width=4) (actual time=152.249..350.805 rows=3 loops=1)

  • Filter: ((deleted_at IS NULL) AND (type = 2) AND COALESCE((lower(unaccent((data ->> 'text'::text))) ~~ lower(unaccent('%ALVARO%'::text))), false))
  • Rows Removed by Filter: 113306
Planning time : 0.304 ms
Execution time : 636.459 ms