explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SE0

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

Aggregate (cost=33,160.20..33,160.21 rows=1 width=8) (actual time=91.589..91.590 rows=1 loops=1)

2. 0.167 91.546 ↓ 23.0 735 1

Unique (cost=33,159.64..33,159.80 rows=32 width=4) (actual time=91.263..91.546 rows=735 loops=1)

3. 0.000 91.379 ↓ 56.5 1,809 1

Sort (cost=33,159.64..33,159.72 rows=32 width=4) (actual time=91.262..91.379 rows=1,809 loops=1)

  • Sort Key: action_required_actionrequired.client_id
  • Sort Method: quicksort Memory: 133kB
4. 3.181 91.652 ↓ 56.5 1,809 1

Gather (cost=1,226.85..33,158.84 rows=32 width=4) (actual time=2.754..91.652 rows=1,809 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
5. 4.827 88.471 ↓ 47.6 904 2 / 2

Hash Semi Join (cost=226.85..32,155.64 rows=19 width=4) (actual time=1.779..88.471 rows=904 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 17:48:44.639354'::timestamp without time zone) THEN action_required_actionrequired.site_team_group_id ELSE accounts_employeegroup.central_leasing_team_id END = u0.id)
6. 13.104 83.582 ↑ 1.1 26,007 2 / 2

Nested Loop (cost=219.93..31,900.52 rows=27,966 width=21) (actual time=1.373..83.582 rows=26,007 loops=2)

7. 6.289 18.464 ↑ 1.1 26,007 2 / 2

Hash Join (cost=219.50..2,998.97 rows=27,966 width=13) (actual time=1.359..18.464 rows=26,007 loops=2)

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

Parallel Seq Scan on action_required_actionrequired (cost=0.00..2,705.85 rows=27,966 width=9) (actual time=0.005..10.835 rows=26,007 loops=2)

  • Filter: ((NOT action_completed) AND (polymorphic_ctype_id = 317))
  • Rows Removed by Filter: 52704
9. 0.259 1.340 ↑ 1.0 1,489 2 / 2

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

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

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

11. 52.014 52.014 ↑ 1.0 1 52,014 / 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,014)

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

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

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

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

14. 0.020 0.020 ↓ 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.015..0.020 rows=8 loops=2)

  • Index Cond: (user_id = 30738)
15. 0.032 0.032 ↑ 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.004..0.004 rows=1 loops=16)

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