explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xATR

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 41.121 ↓ 0.0 0 1

Nested Loop (cost=287.33..295.76 rows=1 width=207) (actual time=41.120..41.121 rows=0 loops=1)

2. 0.000 41.119 ↓ 0.0 0 1

Nested Loop (cost=287.19..295.33 rows=1 width=223) (actual time=41.119..41.119 rows=0 loops=1)

3. 0.000 41.119 ↓ 0.0 0 1

Nested Loop (cost=286.90..294.94 rows=1 width=223) (actual time=41.119..41.119 rows=0 loops=1)

4. 0.000 41.119 ↓ 0.0 0 1

Unique (cost=286.62..286.63 rows=1 width=16) (actual time=41.119..41.119 rows=0 loops=1)

5. 0.008 41.119 ↓ 0.0 0 1

Sort (cost=286.62..286.63 rows=1 width=16) (actual time=41.118..41.119 rows=0 loops=1)

  • Sort Key: users_1.id
  • Sort Method: quicksort Memory: 25kB
6. 0.000 41.111 ↓ 0.0 0 1

Nested Loop (cost=274.37..286.61 rows=1 width=16) (actual time=41.111..41.111 rows=0 loops=1)

7. 0.119 41.111 ↓ 0.0 0 1

Nested Loop (cost=274.37..285.56 rows=1 width=16) (actual time=41.111..41.111 rows=0 loops=1)

  • Join Filter: ((accesses.resource_id = facility_groups.organization_id) OR (facility_groups.id = facilities.facility_group_id))
8. 0.081 40.562 ↓ 86.0 86 1

Hash Join (cost=273.62..280.12 rows=1 width=64) (actual time=40.472..40.562 rows=86 loops=1)

  • Hash Cond: (facility_groups.organization_id = accesses.resource_id)
9. 0.034 0.034 ↑ 1.0 181 1

Seq Scan on facility_groups (cost=0.00..5.81 rows=181 width=32) (actual time=0.008..0.034 rows=181 loops=1)

10. 12.975 40.447 ↓ 1,832.2 21,987 1

Hash (cost=273.47..273.47 rows=12 width=32) (actual time=40.447..40.447 rows=21,987 loops=1)

  • Buckets: 32,768 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1,631kB
11. 7.491 27.472 ↓ 1,832.2 21,987 1

Nested Loop (cost=8.61..273.47 rows=12 width=32) (actual time=0.861..27.472 rows=21,987 loops=1)

  • Join Filter: (user_authentications_1.user_id = accesses.user_id)
12. 0.179 3.740 ↓ 36.3 109 1

Nested Loop (cost=8.32..177.46 rows=3 width=32) (actual time=0.829..3.740 rows=109 loops=1)

13. 0.146 2.616 ↓ 45.0 135 1

Hash Join (cost=8.04..161.94 rows=3 width=16) (actual time=0.812..2.616 rows=135 loops=1)

  • Hash Cond: (user_authentications_1.authenticatable_id = email_authentications_1.id)
14. 2.342 2.342 ↓ 1.2 137 1

Seq Scan on user_authentications user_authentications_1 (cost=0.00..153.61 rows=110 width=32) (actual time=0.675..2.342 rows=137 loops=1)

  • Filter: ((deleted_at IS NULL) AND ((authenticatable_type)::text = 'EmailAuthentication'::text))
  • Rows Removed by Filter: 5,379
15. 0.046 0.128 ↑ 1.0 135 1

Hash (cost=6.35..6.35 rows=135 width=16) (actual time=0.128..0.128 rows=135 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
16. 0.082 0.082 ↑ 1.0 135 1

Seq Scan on email_authentications email_authentications_1 (cost=0.00..6.35 rows=135 width=16) (actual time=0.008..0.082 rows=135 loops=1)

  • Filter: ((deleted_at IS NULL) AND (id IS NOT NULL))
17. 0.945 0.945 ↑ 1.0 1 135

Index Scan using master_users_pkey on users users_1 (cost=0.28..5.17 rows=1 width=16) (actual time=0.007..0.007 rows=1 loops=135)

  • Index Cond: (id = user_authentications_1.user_id)
  • Filter: (deleted_at IS NULL)
18. 16.241 16.241 ↑ 5.2 202 109

Index Scan using index_accesses_on_user_id on accesses (cost=0.29..18.92 rows=1,047 width=32) (actual time=0.005..0.149 rows=202 loops=109)

  • Index Cond: (user_id = users_1.id)
  • Filter: (deleted_at IS NULL)
19. 0.000 0.430 ↓ 0.0 0 86

Bitmap Heap Scan on facilities (cost=0.75..5.10 rows=23 width=32) (actual time=0.005..0.005 rows=0 loops=86)

  • Recheck Cond: ((accesses.resource_id = id) OR (accesses.resource_id = facility_group_id))
20. 0.086 0.430 ↓ 0.0 0 86

BitmapOr (cost=0.75..0.75 rows=23 width=0) (actual time=0.005..0.005 rows=0 loops=86)

21. 0.172 0.172 ↓ 0.0 0 86

Bitmap Index Scan on facilities_pkey (cost=0.00..0.29 rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=86)

  • Index Cond: (accesses.resource_id = id)
22. 0.172 0.172 ↓ 0.0 0 86

Bitmap Index Scan on index_facilities_on_facility_group_id (cost=0.00..0.45 rows=22 width=0) (actual time=0.002..0.002 rows=0 loops=86)

  • Index Cond: (accesses.resource_id = facility_group_id)
23. 0.000 0.000 ↓ 0.0 0

Seq Scan on organizations (cost=0.00..1.04 rows=1 width=0) (never executed)

  • Filter: (id = '89008920-021e-4116-b74c-8edf86180dd6'::uuid)
24. 0.000 0.000 ↓ 0.0 0

Index Scan using master_users_pkey on users (cost=0.28..8.30 rows=1 width=207) (never executed)

  • Index Cond: (id = users_1.id)
  • Filter: (deleted_at IS NULL)
25. 0.000 0.000 ↓ 0.0 0

Index Scan using index_user_authentications_on_user_id on user_authentications (cost=0.28..0.38 rows=1 width=32) (never executed)

  • Index Cond: (user_id = users.id)
  • Filter: ((deleted_at IS NULL) AND ((authenticatable_type)::text = 'EmailAuthentication'::text))
26. 0.000 0.000 ↓ 0.0 0

Index Scan using email_authentications_pkey on email_authentications (cost=0.14..0.42 rows=1 width=16) (never executed)

  • Index Cond: ((id = user_authentications.authenticatable_id) AND (id IS NOT NULL))
  • Filter: (deleted_at IS NULL)