explain.depesz.com

PostgreSQL's explain analyze made readable

Result: waPZ

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 473.018 ↓ 0.0 0 1

Sort (cost=41,426.59..41,426.59 rows=1 width=32) (actual time=473.018..473.018 rows=0 loops=1)

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

Nested Loop (cost=227.62..41,426.58 rows=1 width=32) (actual time=473.013..473.013 rows=0 loops=1)

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

Nested Loop (cost=227.62..41,424.75 rows=1 width=24) (actual time=473.012..473.012 rows=0 loops=1)

4. 0.287 6.691 ↑ 1.4 184 1

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

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

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

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

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

7. 0.151 0.553 ↑ 1.0 291 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 20kB
8. 0.378 0.402 ↑ 1.0 291 1

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

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

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

  • Index Cond: (department_id = 1)
10. 0.007 0.016 ↑ 1.0 9 1

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

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

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

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

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

  • Index Cond: (user_id = u.id)
  • Filter: ((((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)