explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uuoV

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.044 93.688 ↑ 1.0 1 1

Aggregate (cost=33,219.60..33,219.61 rows=1 width=8) (actual time=93.688..93.688 rows=1 loops=1)

2. 0.161 93.644 ↓ 23.1 739 1

Unique (cost=33,219.04..33,219.20 rows=32 width=4) (actual time=93.379..93.644 rows=739 loops=1)

3. 0.153 93.483 ↓ 56.7 1,815 1

Sort (cost=33,219.04..33,219.12 rows=32 width=4) (actual time=93.378..93.483 rows=1,815 loops=1)

  • Sort Key: action_required_actionrequired.client_id
  • Sort Method: quicksort Memory: 134kB
4. 2.474 93.330 ↓ 56.7 1,815 1

Gather (cost=1,226.85..33,218.24 rows=32 width=4) (actual time=1.727..93.330 rows=1,815 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
5. 5.185 90.856 ↓ 47.8 908 2 / 2

Hash Semi Join (cost=226.85..32,215.04 rows=19 width=4) (actual time=1.334..90.856 rows=908 loops=2)

  • Hash Cond: (CASE WHEN action_required_actionrequired.is_handed_off THEN action_required_actionrequired.site_team_group_id WHEN (clients_client.created_at < '2020-05-19 18:30:30.433375'::timestamp without time zone) THEN action_required_actionrequired.site_team_group_id ELSE accounts_employeegroup.central_leasing_team_id END = u0.id)
6. 13.766 85.574 ↑ 1.1 26,010 2 / 2

Nested Loop (cost=219.93..31,959.16 rows=28,051 width=21) (actual time=1.049..85.574 rows=26,010 loops=2)

7. 6.710 19.787 ↑ 1.1 26,010 2 / 2

Hash Join (cost=219.50..3,002.70 rows=28,051 width=13) (actual time=1.038..19.787 rows=26,010 loops=2)

  • Hash Cond: (action_required_actionrequired.site_team_group_id = accounts_employeegroup.id)
8. 12.054 12.054 ↑ 1.1 26,010 2 / 2

Parallel Seq Scan on action_required_actionrequired (cost=0.00..2,709.35 rows=28,051 width=9) (actual time=0.005..12.054 rows=26,010 loops=2)

  • Filter: ((NOT action_completed) AND (polymorphic_ctype_id = 317))
  • Rows Removed by Filter: 52908
9. 0.181 1.023 ↑ 1.0 1,489 2 / 2

Hash (cost=200.89..200.89 rows=1,489 width=8) (actual time=1.023..1.023 rows=1,489 loops=2)

  • Buckets: 2048 Batches: 1 Memory Usage: 70kB
10. 0.842 0.842 ↑ 1.0 1,489 2 / 2

Seq Scan on accounts_employeegroup (cost=0.00..200.89 rows=1,489 width=8) (actual time=0.005..0.842 rows=1,489 loops=2)

11. 52.021 52.021 ↑ 1.0 1 52,021 / 2

Index Scan using clients_client_pkey on clients_client (cost=0.42..1.03 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=52,021)

  • Index Cond: (id = action_required_actionrequired.client_id)
12. 0.005 0.097 ↓ 4.0 8 2 / 2

Hash (cost=6.90..6.90 rows=2 width=8) (actual time=0.097..0.097 rows=8 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.003 0.092 ↓ 4.0 8 2 / 2

Nested Loop (cost=0.56..6.90 rows=2 width=8) (actual time=0.077..0.092 rows=8 loops=2)

14. 0.065 0.065 ↓ 4.0 8 2 / 2

Index Scan using accounts_employeegroup_employees_e8701ad4 on accounts_employeegroup_employees u1 (cost=0.29..3.00 rows=2 width=4) (actual time=0.061..0.065 rows=8 loops=2)

  • Index Cond: (user_id = 30738)
15. 0.024 0.024 ↑ 1.0 1 16 / 2

Index Only Scan using accounts_employeegroup_pkey on accounts_employeegroup u0 (cost=0.28..1.95 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=16)

  • Index Cond: (id = u1.employeegroup_id)
  • Heap Fetches: 2
Planning time : 1.732 ms
Execution time : 94.323 ms