explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Od1I

Settings
# exclusive inclusive rows x rows loops node
1. 0.021 1,288.860 ↓ 0.0 0 1

Sort (cost=29,415.38..29,415.54 rows=61 width=32) (actual time=1,288.860..1,288.860 rows=0 loops=1)

  • Sort Key: t.created_on DESC
  • Sort Method: quicksort Memory: 25kB
2. 0.004 1,288.839 ↓ 0.0 0 1

Merge Join (cost=1.13..29,413.58 rows=61 width=32) (actual time=1,288.839..1,288.839 rows=0 loops=1)

  • Merge Cond: (e.office_id = o.id)
3. 0.018 1,288.835 ↓ 0.0 0 1

Nested Loop (cost=0.99..51,800.08 rows=74 width=36) (actual time=1,288.834..1,288.835 rows=0 loops=1)

  • Join Filter: (t.task_status_id = ts.id)
4. 0.352 1,288.817 ↓ 0.0 0 1

Nested Loop (cost=0.99..51,758.60 rows=74 width=28) (actual time=1,288.817..1,288.817 rows=0 loops=1)

5. 0.447 7.960 ↑ 1.0 285 1

Nested Loop (cost=0.56..2,669.90 rows=292 width=8) (actual time=0.144..7.960 rows=285 loops=1)

6. 4.323 4.323 ↑ 1.1 290 1

Index Scan using idx_employees_office_id on employees e (cost=0.28..1,015.04 rows=306 width=8) (actual time=0.112..4.323 rows=290 loops=1)

  • Filter: (department_id = 1)
  • Rows Removed by Filter: 5577
7. 3.190 3.190 ↑ 1.0 1 290

Index Scan using idx_users_employee_id on users u (cost=0.28..5.40 rows=1 width=8) (actual time=0.007..0.011 rows=1 loops=290)

  • Index Cond: (employee_id = e.id)
8. 1,280.505 1,280.505 ↓ 0.0 0 285

Index Scan using idx_tasks_user_id on tasks t (cost=0.43..168.10 rows=1 width=28) (actual time=4.493..4.493 rows=0 loops=285)

  • Index Cond: (user_id = u.id)
  • Filter: ((task_status_id <> 7) AND ((call_id IS NULL) OR ((call_id IS NOT NULL) AND (user_id <> created_by) AND (user_id <> 1131))) AND (task_type_id = ANY ('{5,6,61,13,7}'::integer[])) AND (((completed_on)::date = CURRENT_DATE) OR (completed_on IS NULL)) AND (((created_on)::date = CURRENT_DATE) OR ((completed_on)::date = CURRENT_DATE)))
  • Rows Removed by Filter: 1558
9. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.56 rows=37 width=16) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Seq Scan on task_statuses ts (cost=0.00..1.37 rows=37 width=16) (never executed)

11. 0.000 0.000 ↓ 0.0 0

Index Scan using offices_pkey on offices o (cost=0.14..12.33 rows=9 width=4) (never executed)

  • Filter: ((country_code)::text = 'US'::text)