explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qtOF

Settings
# exclusive inclusive rows x rows loops node
1. 0.072 196.889 ↑ 1.0 1 1

Aggregate (cost=23,641.08..23,641.09 rows=1 width=8) (actual time=196.888..196.889 rows=1 loops=1)

2. 0.157 196.817 ↓ 184.5 738 1

Unique (cost=23,641.01..23,641.03 rows=4 width=4) (actual time=196.555..196.817 rows=738 loops=1)

3. 0.658 196.660 ↓ 453.5 1,814 1

Sort (cost=23,641.01..23,641.02 rows=4 width=4) (actual time=196.554..196.660 rows=1,814 loops=1)

  • Sort Key: action_required_actionrequired.client_id
  • Sort Method: quicksort Memory: 134kB
4. 12.427 196.002 ↓ 453.5 1,814 1

Hash Semi Join (cost=19,921.02..23,640.97 rows=4 width=4) (actual time=117.078..196.002 rows=1,814 loops=1)

  • 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:37:58.628361'::timestamp without time zone) THEN action_required_actionrequired.site_team_group_id ELSE accounts_employeegroup.central_leasing_team_id END = u0.id)
5. 14.932 183.541 ↓ 7.9 51,511 1

Hash Join (cost=19,914.10..23,576.54 rows=6,481 width=21) (actual time=116.960..183.541 rows=51,511 loops=1)

  • Hash Cond: (action_required_actionrequired.site_team_group_id = accounts_employeegroup.id)
6. 23.823 167.609 ↓ 7.9 51,511 1

Hash Join (cost=19,694.60..23,339.98 rows=6,481 width=17) (actual time=115.954..167.609 rows=51,511 loops=1)

  • Hash Cond: (action_required_actionrequired.client_id = clients_client.id)
7. 28.289 28.289 ↓ 1.1 52,013 1

Seq Scan on action_required_actionrequired (cost=0.00..3,520.20 rows=47,687 width=9) (actual time=0.004..28.289 rows=52,013 loops=1)

  • Filter: ((NOT action_completed) AND (polymorphic_ctype_id = 317))
  • Rows Removed by Filter: 105873
8. 26.126 115.497 ↓ 1.0 98,732 1

Hash (cost=18,492.16..18,492.16 rows=96,195 width=12) (actual time=115.497..115.497 rows=98,732 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 5653kB
9. 89.371 89.371 ↓ 1.0 98,732 1

Index Scan using clients_client_brokerage_id on clients_client (cost=0.42..18,492.16 rows=96,195 width=12) (actual time=0.015..89.371 rows=98,732 loops=1)

  • Index Cond: (brokerage_id = 18855)
10. 0.160 1.000 ↑ 1.0 1,489 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 70kB
11. 0.840 0.840 ↑ 1.0 1,489 1

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

12. 0.002 0.034 ↓ 4.0 8 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.006 0.032 ↓ 4.0 8 1

Nested Loop (cost=0.56..6.90 rows=2 width=8) (actual time=0.018..0.032 rows=8 loops=1)

14. 0.010 0.010 ↓ 4.0 8 1

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

  • Index Cond: (user_id = 30738)
15. 0.016 0.016 ↑ 1.0 1 8

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

  • Index Cond: (id = u1.employeegroup_id)
  • Heap Fetches: 1
Planning time : 1.032 ms
Execution time : 197.039 ms