explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KKFB

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 326.628 ↓ 2.0 2 1

Group (cost=31,922.73..31,922.74 rows=1 width=48) (actual time=326.626..326.628 rows=2 loops=1)

  • Group Key: ap.id, uug.user_id
  • Group Key: ap.id, uug.user_id
2. 0.015 326.624 ↓ 2.0 2 1

Sort (cost=31,922.73..31,922.73 rows=1 width=32) (actual time=326.623..326.624 rows=2 loops=1)

  • Sort Key: ap.id, uug.user_id
  • Sort Method: quicksort Memory: 25kB
3. 0.000 326.609 ↓ 2.0 2 1

Nested Loop Left Join (cost=1,008.87..31,922.72 rows=1 width=32) (actual time=175.419..326.609 rows=2 loops=1)

  • Join Filter: (apa.attendance_period_id = ap.id)
4. 0.007 0.313 ↓ 2.0 2 1

Nested Loop (cost=0.56..16.61 rows=1 width=16) (actual time=0.014..0.313 rows=2 loops=1)

5. 0.012 0.012 ↓ 2.0 2 1

Index Scan using attendances_patient_id_idx on attendances a (cost=0.28..8.30 rows=1 width=16) (actual time=0.007..0.012 rows=2 loops=1)

  • Index Cond: (patient_id = '54d9df16-5371-11e8-80ea-034fb4ed6904'::uuid)
6. 0.294 0.294 ↑ 1.0 1 2

Index Scan using attendance_periods_attendance_id_idx on attendance_periods ap (cost=0.28..8.30 rows=1 width=32) (actual time=0.106..0.147 rows=1 loops=2)

  • Index Cond: (attendance_id = a.id)
7. 24.700 332.006 ↓ 0.0 0 2

Gather (cost=1,008.30..31,864.34 rows=3,341 width=32) (actual time=163.144..166.003 rows=0 loops=2)

  • Workers Planned: 2
  • Workers Launched: 2
8. 146.530 307.306 ↓ 0.0 0 6 / 3

Hash Join (cost=8.30..30,530.24 rows=1,392 width=32) (actual time=153.652..153.653 rows=0 loops=6)

  • Hash Cond: (apa.user_group_id = uug.user_group_id)
9. 160.736 160.736 ↑ 1.4 473,833 6 / 3

Parallel Seq Scan on attendance_period_acl apa (cost=0.00..28,712.00 rows=683,600 width=32) (actual time=0.021..80.368 rows=473,833 loops=6)

10. 0.007 0.040 ↑ 1.0 1 5 / 3

Hash (cost=8.29..8.29 rows=1 width=32) (actual time=0.024..0.024 rows=1 loops=5)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.033 0.033 ↑ 1.0 1 5 / 3

Index Scan using users_user_groups_user_id_idx on users_user_groups uug (cost=0.27..8.29 rows=1 width=32) (actual time=0.020..0.020 rows=1 loops=5)

  • Index Cond: (user_id = '67228252-86e1-48a9-b78d-1361694f75b5'::uuid)
12. 0.015 326.624 ↓ 2.0 2 1

Sort (cost=31,922.73..31,922.73 rows=1 width=32) (actual time=326.623..326.624 rows=2 loops=1)

  • Sort Key: ap.id, uug.user_id
  • Sort Method: quicksort Memory: 25kB
13. 0.000 326.609 ↓ 2.0 2 1

Nested Loop Left Join (cost=1,008.87..31,922.72 rows=1 width=32) (actual time=175.419..326.609 rows=2 loops=1)

  • Join Filter: (apa.attendance_period_id = ap.id)
14. 0.007 0.313 ↓ 2.0 2 1

Nested Loop (cost=0.56..16.61 rows=1 width=16) (actual time=0.014..0.313 rows=2 loops=1)

15. 0.012 0.012 ↓ 2.0 2 1

Index Scan using attendances_patient_id_idx on attendances a (cost=0.28..8.30 rows=1 width=16) (actual time=0.007..0.012 rows=2 loops=1)

  • Index Cond: (patient_id = '54d9df16-5371-11e8-80ea-034fb4ed6904'::uuid)
16. 0.294 0.294 ↑ 1.0 1 2

Index Scan using attendance_periods_attendance_id_idx on attendance_periods ap (cost=0.28..8.30 rows=1 width=32) (actual time=0.106..0.147 rows=1 loops=2)

  • Index Cond: (attendance_id = a.id)
17. 24.700 332.006 ↓ 0.0 0 2

Gather (cost=1,008.30..31,864.34 rows=3,341 width=32) (actual time=163.144..166.003 rows=0 loops=2)

  • Workers Planned: 2
  • Workers Launched: 2
18. 146.530 307.306 ↓ 0.0 0 6 / 3

Hash Join (cost=8.30..30,530.24 rows=1,392 width=32) (actual time=153.652..153.653 rows=0 loops=6)

  • Hash Cond: (apa.user_group_id = uug.user_group_id)
19. 160.736 160.736 ↑ 1.4 473,833 6 / 3

Parallel Seq Scan on attendance_period_acl apa (cost=0.00..28,712.00 rows=683,600 width=32) (actual time=0.021..80.368 rows=473,833 loops=6)

20. 0.007 0.040 ↑ 1.0 1 5 / 3

Hash (cost=8.29..8.29 rows=1 width=32) (actual time=0.024..0.024 rows=1 loops=5)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
21. 0.033 0.033 ↑ 1.0 1 5 / 3

Index Scan using users_user_groups_user_id_idx on users_user_groups uug (cost=0.27..8.29 rows=1 width=32) (actual time=0.020..0.020 rows=1 loops=5)

  • Index Cond: (user_id = '67228252-86e1-48a9-b78d-1361694f75b5'::uuid)
Planning time : 0.528 ms
Execution time : 332.398 ms