explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lEDt

Settings
# exclusive inclusive rows x rows loops node
1. 0.045 93.741 ↑ 1.0 1 1

Aggregate (cost=31,881.62..31,881.63 rows=1 width=8) (actual time=93.740..93.741 rows=1 loops=1)

2. 0.000 93.696 ↑ 50.0 453 1

HashAggregate (cost=31,371.50..31,598.22 rows=22,672 width=4) (actual time=93.485..93.696 rows=453 loops=1)

  • Group Key: action_required_actionrequired.client_id
3. 3.298 94.208 ↑ 21.1 1,085 1

Gather (cost=1,240.90..31,314.16 rows=22,933 width=4) (actual time=4.585..94.208 rows=1,085 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 11.006 90.910 ↑ 24.9 542 2 / 2

Hash Join (cost=240.90..28,020.86 rows=13,490 width=4) (actual time=2.722..90.910 rows=542 loops=2)

  • Hash Cond: (action_required_actionrequired.site_team_group_id = accounts_employeegroup.id)
  • Join Filter: (((action_required_actionrequired.is_handed_off OR (clients_client.created_at < '2020-05-19 19:35:41.442499'::timestamp without time zone)) AND (hashed SubPlan 1)) OR ((NOT action_required_actionrequired.is_handed_off) AND (clients_client.created_at > '2020-05-19 19:35:41.442499'::timestamp without time zone) AND (hashed SubPlan 2)))
  • Rows Removed by Join Filter: 24260
5. 14.008 78.635 ↓ 1.1 24,803 2 / 2

Nested Loop (cost=7.33..27,728.95 rows=22,168 width=17) (actual time=0.067..78.635 rows=24,803 loops=2)

6. 14.896 15.021 ↓ 1.1 24,803 2 / 2

Parallel Seq Scan on action_required_actionrequired (cost=6.90..2,954.20 rows=22,168 width=9) (actual time=0.051..15.021 rows=24,803 loops=2)

  • Filter: ((NOT action_completed) AND (polymorphic_ctype_id = 317) AND ((hashed SubPlan 1) OR (NOT is_handed_off)))
  • Rows Removed by Filter: 54421
7.          

SubPlan (for Parallel Seq Scan)

8. 0.020 0.125 ↓ 3.0 6 10 / 2

Nested Loop (cost=0.56..6.90 rows=2 width=4) (actual time=0.017..0.025 rows=6 loops=10)

9. 0.045 0.045 ↓ 3.0 6 10 / 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.006..0.009 rows=6 loops=10)

  • Index Cond: (user_id = 30867)
10. 0.060 0.060 ↑ 1.0 1 60 / 2

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=60)

  • Index Cond: (id = u1.employeegroup_id)
  • Heap Fetches: 0
11. 49.606 49.606 ↑ 1.0 1 49,606 / 2

Index Scan using clients_client_pkey on clients_client (cost=0.42..1.12 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=49,606)

  • Index Cond: (id = action_required_actionrequired.client_id)
12. 0.226 1.246 ↑ 1.0 1,489 2 / 2

Hash (cost=201.01..201.01 rows=1,501 width=8) (actual time=1.246..1.246 rows=1,489 loops=2)

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

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

14.          

SubPlan (for Hash Join)

15. 0.002 0.023 ↓ 3.0 6 2 / 2

Nested Loop (cost=0.56..6.90 rows=2 width=4) (actual time=0.016..0.023 rows=6 loops=2)

16. 0.009 0.009 ↓ 3.0 6 2 / 2

Index Scan using accounts_employeegroup_employees_e8701ad4 on accounts_employeegroup_employees u1_1 (cost=0.29..3.00 rows=2 width=4) (actual time=0.007..0.009 rows=6 loops=2)

  • Index Cond: (user_id = 30867)
17. 0.012 0.012 ↑ 1.0 1 12 / 2

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

  • Index Cond: (id = u1_1.employeegroup_id)
  • Heap Fetches: 0
Planning time : 1.904 ms
Execution time : 95.467 ms