explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eZeF

Settings
# exclusive inclusive rows x rows loops node
1. 0.031 1,220.495 ↓ 26.0 26 1

Nested Loop (cost=323.54..358.08 rows=1 width=207) (actual time=1,215.580..1,220.495 rows=26 loops=1)

2. 0.023 1,220.386 ↓ 26.0 26 1

Nested Loop (cost=323.39..357.66 rows=1 width=223) (actual time=1,215.570..1,220.386 rows=26 loops=1)

3. 0.038 1,220.233 ↓ 6.5 26 1

Nested Loop (cost=323.11..356.09 rows=4 width=223) (actual time=1,215.544..1,220.233 rows=26 loops=1)

4. 2.851 1,220.039 ↓ 6.5 26 1

Unique (cost=322.83..322.85 rows=4 width=16) (actual time=1,215.511..1,220.039 rows=26 loops=1)

5. 16.801 1,217.188 ↓ 5,496.0 21,984 1

Sort (cost=322.83..322.84 rows=4 width=16) (actual time=1,215.509..1,217.188 rows=21,984 loops=1)

  • Sort Key: users_1.id
  • Sort Method: quicksort Memory: 1,799kB
6. 7.693 1,200.387 ↓ 5,496.0 21,984 1

Nested Loop (cost=8.89..322.79 rows=4 width=16) (actual time=1.253..1,200.387 rows=21,984 loops=1)

  • Join Filter: ((organizations.id = facility_groups.organization_id) OR (accesses.resource_id = organizations.id))
  • Rows Removed by Join Filter: 3
7. 0.010 0.010 ↑ 1.0 1 1

Seq Scan on organizations (cost=0.00..1.04 rows=1 width=16) (actual time=0.009..0.010 rows=1 loops=1)

  • Filter: (id = '89008920-021e-4116-b74c-8edf86180dd6'::uuid)
  • Rows Removed by Filter: 2
8. 720.784 1,192.684 ↓ 1,691.3 21,987 1

Nested Loop Left Join (cost=8.89..321.55 rows=13 width=48) (actual time=1.153..1,192.684 rows=21,987 loops=1)

  • Join Filter: ((facility_groups.id = facilities.facility_group_id) OR (accesses.resource_id = facility_groups.id))
  • Rows Removed by Join Filter: 3,957,662
9. 23.246 142.095 ↓ 1,832.2 21,987 1

Nested Loop Left Join (cost=8.89..277.28 rows=12 width=48) (actual time=1.073..142.095 rows=21,987 loops=1)

10. 7.499 30.901 ↓ 1,832.2 21,987 1

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

  • Join Filter: (user_authentications_1.user_id = accesses.user_id)
11. 0.142 2.692 ↓ 36.3 109 1

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

12. 0.115 2.010 ↓ 45.0 135 1

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

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

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

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

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
15. 0.083 0.083 ↑ 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.083 rows=135 loops=1)

  • Filter: ((deleted_at IS NULL) AND (id IS NOT NULL))
16. 0.540 0.540 ↑ 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.004..0.004 rows=1 loops=135)

  • Index Cond: (id = user_authentications_1.user_id)
  • Filter: (deleted_at IS NULL)
17. 20.710 20.710 ↑ 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.004..0.190 rows=202 loops=109)

  • Index Cond: (user_id = users_1.id)
  • Filter: (deleted_at IS NULL)
18. 87.948 87.948 ↑ 1.0 1 21,987

Index Scan using facilities_pkey on facilities (cost=0.28..0.32 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=21,987)

  • Index Cond: (accesses.resource_id = id)
19. 329.753 329.805 ↑ 1.0 181 21,987

Materialize (cost=0.00..6.72 rows=181 width=32) (actual time=0.000..0.015 rows=181 loops=21,987)

20. 0.052 0.052 ↑ 1.0 181 1

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

21. 0.156 0.156 ↑ 1.0 1 26

Index Scan using master_users_pkey on users (cost=0.28..8.30 rows=1 width=207) (actual time=0.006..0.006 rows=1 loops=26)

  • Index Cond: (id = users_1.id)
  • Filter: (deleted_at IS NULL)
22. 0.130 0.130 ↑ 1.0 1 26

Index Scan using index_user_authentications_on_user_id on user_authentications (cost=0.28..0.38 rows=1 width=32) (actual time=0.004..0.005 rows=1 loops=26)

  • Index Cond: (user_id = users.id)
  • Filter: ((deleted_at IS NULL) AND ((authenticatable_type)::text = 'EmailAuthentication'::text))
23. 0.078 0.078 ↑ 1.0 1 26

Index Scan using email_authentications_pkey on email_authentications (cost=0.14..0.42 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=26)

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