explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6XwB

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

Limit (cost=134,796.39..151,570.28 rows=11 width=342) (never executed)

2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=134,796.39..241,539.27 rows=70 width=342) (never executed)

  • Filter: ((unaccent((accounts.name)::text) ~~* unaccent('%daniel%'::text)) OR (unaccent((users.email)::text) ~~* unaccent('%daniel%'::text)) OR (unaccent(staff_members.full_name) ~~* unaccent('%daniel%'::text)))
3. 0.000 0.000 ↓ 0.0

Hash Join (cost=134,796.1..208,429.44 rows=73,300 width=393) (never executed)

4. 0.000 0.000 ↓ 0.0

Gather (cost=134,666.13..146,182.64 rows=73,300 width=366) (never executed)

  • Workers Planned: 2
5. 0.000 0.000 ↓ 0.0

Hash Join (cost=133,666.13..137,852.64 rows=30,542 width=366) (never executed)

6. 0.000 0.000 ↓ 0.0

Merge Join (cost=133,529.62..137,635.61 rows=30,542 width=350) (never executed)

7. 0.000 0.000 ↓ 0.0

Sort (cost=68,081.7..68,158.06 rows=30,542 width=342) (never executed)

  • Sort Key: actions.target_id
8. 0.000 0.000 ↓ 0.0

Seq Scan on actions actions (cost=0..61,001.05 rows=30,542 width=342) (never executed)

  • Filter: ((actions.type)::text = ANY ('{Actions::RequestAction,Actions::Requests::CancelWorkAssignment,Actions::Requests::ExtendWorkAssignment,Actions::Requests::VoluntaryResignation,Actions::Requests::Leaves::PostProcessLeave,Actions::Requests::Novation,Actions::Requests::ReportVacation,Actions::Requests::OtherAction,Actions::Requests::RequestStaff}'::text[]))
9. 0.000 0.000 ↓ 0.0

Materialize (cost=65,447.92..66,438.71 rows=198,159 width=16) (never executed)

10. 0.000 0.000 ↓ 0.0

Sort (cost=65,447.92..65,943.31 rows=198,159 width=16) (never executed)

  • Sort Key: (((work_assignments.id)::character varying)::text)
11. 0.000 0.000 ↓ 0.0

Seq Scan on work_assignments work_assignments (cost=0..44,625.59 rows=198,159 width=16) (never executed)

12. 0.000 0.000 ↓ 0.0

Hash (cost=124.56..124.56 rows=956 width=24) (never executed)

13. 0.000 0.000 ↓ 0.0

Seq Scan on accounts accounts (cost=0..124.56 rows=956 width=24) (never executed)

14. 0.000 0.000 ↓ 0.0

Hash (cost=102.21..102.21 rows=2,221 width=35) (never executed)

15. 0.000 0.000 ↓ 0.0

Seq Scan on users users (cost=0..102.21 rows=2,221 width=35) (never executed)

16. 0.000 0.000 ↓ 0.0

Index Scan using staff_members_pkey on staff_members staff_members (cost=0.29..0.42 rows=1 width=31) (never executed)

  • Index Cond: (work_assignments.staff_member_id = staff_members.id)