explain.depesz.com

PostgreSQL's explain analyze made readable

Result: O2jJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.046 99.341 ↑ 1.0 1 1

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

2. 0.191 99.295 ↓ 23.1 739 1

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

3. 0.085 99.104 ↓ 56.7 1,815 1

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

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

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

  • Workers Planned: 1
  • Workers Launched: 1
5. 5.502 96.099 ↓ 47.8 908 2 / 2

Hash Semi Join (cost=226.85..32,215.04 rows=19 width=4) (actual time=1.983..96.099 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:35:33.442942'::timestamp without time zone) THEN action_required_actionrequired.site_team_group_id ELSE accounts_employeegroup.central_leasing_team_id END = u0.id)
6. 16.870 90.541 ↑ 1.1 26,010 2 / 2

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

7. 7.226 21.651 ↑ 1.1 26,010 2 / 2

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

  • Hash Cond: (action_required_actionrequired.site_team_group_id = accounts_employeegroup.id)
8. 13.123 13.123 ↑ 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.003..13.123 rows=26,010 loops=2)

  • Filter: ((NOT action_completed) AND (polymorphic_ctype_id = 317))
  • Rows Removed by Filter: 52922
9. 0.224 1.302 ↑ 1.0 1,489 2 / 2

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

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

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

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

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

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

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

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

14. 0.017 0.017 ↓ 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.011..0.017 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 : 0.911 ms
Execution time : 100.073 ms