explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cHYm

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 466.631 ↓ 0.0 0 1

Sort (cost=44,479.03..44,479.04 rows=1 width=32) (actual time=466.630..466.631 rows=0 loops=1)

  • Sort Key: t.created_on DESC
  • Sort Method: quicksort Memory: 25kB
2. 0.001 466.623 ↓ 0.0 0 1

Nested Loop (cost=227.62..44,479.02 rows=1 width=32) (actual time=466.623..466.623 rows=0 loops=1)

  • Join Filter: (t.task_status_id = ts.id)
3. 0.235 466.622 ↓ 0.0 0 1

Nested Loop (cost=227.62..44,477.19 rows=1 width=24) (actual time=466.621..466.622 rows=0 loops=1)

4. 0.321 7.123 ↑ 1.4 184 1

Hash Join (cost=227.20..453.19 rows=254 width=4) (actual time=0.762..7.123 rows=184 loops=1)

  • Hash Cond: (e.office_id = o.id)
5. 3.282 6.781 ↑ 1.1 286 1

Hash Join (cost=225.95..450.95 rows=310 width=8) (actual time=0.732..6.781 rows=286 loops=1)

  • Hash Cond: (u.employee_id = e.id)
6. 2.783 2.783 ↑ 1.1 5,871 1

Seq Scan on users u (cost=0.00..208.57 rows=6,257 width=8) (actual time=0.006..2.783 rows=5,871 loops=1)

7. 0.200 0.716 ↑ 1.0 291 1

Hash (cost=222.26..222.26 rows=295 width=8) (actual time=0.716..0.716 rows=291 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 20kB
8. 0.482 0.516 ↑ 1.0 291 1

Bitmap Heap Scan on employees e (cost=6.57..222.26 rows=295 width=8) (actual time=0.056..0.516 rows=291 loops=1)

  • Recheck Cond: (department_id = 1)
  • Heap Blocks: exact=127
9. 0.034 0.034 ↑ 1.0 291 1

Bitmap Index Scan on idx_employees_department_id (cost=0.00..6.50 rows=295 width=0) (actual time=0.034..0.034 rows=291 loops=1)

  • Index Cond: (department_id = 1)
10. 0.008 0.021 ↑ 1.0 9 1

Hash (cost=1.14..1.14 rows=9 width=4) (actual time=0.021..0.021 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.013 0.013 ↑ 1.0 9 1

Seq Scan on offices o (cost=0.00..1.14 rows=9 width=4) (actual time=0.006..0.013 rows=9 loops=1)

  • Filter: ((country_code)::text = 'US'::text)
  • Rows Removed by Filter: 2
12. 459.264 459.264 ↓ 0.0 0 184

Index Scan using idx_tasks_user_id on tasks t (cost=0.43..173.31 rows=1 width=28) (actual time=2.496..2.496 rows=0 loops=184)

  • 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 >= CURRENT_DATE) AND (completed_on <= (CURRENT_DATE + '1 day'::interval))) OR (completed_on IS NULL)) AND (((created_on >= CURRENT_DATE) AND (created_on <= (CURRENT_DATE + '1 day'::interval))) OR ((completed_on >= CURRENT_DATE) AND (completed_on <= (CURRENT_DATE + '1 day'::interval)))))
  • Rows Removed by Filter: 1560
13. 0.000 0.000 ↓ 0.0 0

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