explain.depesz.com

PostgreSQL's explain analyze made readable

Result: k2GV

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=5,638,720.37..5,638,720.39 rows=5 width=422) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=5,638,720.37..5,638,792.18 rows=28,723 width=422) (actual rows= loops=)

  • Sort Key: users.first_name
3. 0.000 0.000 ↓ 0.0

Seq Scan on users (cost=0.00..5,638,243.30 rows=28,723 width=422) (actual rows= loops=)

  • Filter: ((((first_name ~~* 'владимир%'::text) OR (first_name ~~* 'владимирович%'::text)) AND ((last_name ~~* 'владимир%'::text) OR (last_name ~~* 'владимирович%'::text)) AND ((""position"" ~~* 'владимир%'::text) OR (""position"" ~~* 'владимирович%'::text))) OR (SubPlan 1))
4.          

SubPlan (for Seq Scan)

5. 0.000 0.000 ↓ 0.0

Seq Scan on departments (cost=0.00..196.12 rows=2 width=0) (actual rows= loops=)

  • Filter: ((users.department_id = id) OR (name ~~* 'владимир%'::text) OR (name ~~* 'владимирович%'::text))