explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wCuH : Existing query inner join 0r

Settings
# exclusive inclusive rows x rows loops node
1. 0.014 1.612 ↑ 6.2 5 1

Unique (cost=76.93..78.10 rows=31 width=622) (actual time=1.598..1.612 rows=5 loops=1)

2. 0.278 1.598 ↑ 6.2 5 1

Sort (cost=76.93..77.01 rows=31 width=622) (actual time=1.598..1.598 rows=5 loops=1)

  • Sort Key: u.id, u.sales_email_pref, u.login, u.first_name, u.last_name, u.email, u.lang_key, np.restaurantunit_id, c.id, c.name, ru.name, ru.tenant_id, ((date_part('hour'::text, timezone((ru.unit_tz)::text, CURRENT_TIMESTAMP)) >= (ru.sales_email_hour)::double precision)), (date_part('doy'::text, timezone((ru.unit_tz)::text, CURRENT_TIMESTAMP)))
  • Sort Method: quicksort Memory: 26kB
3. 1.027 1.320 ↑ 6.2 5 1

Hash Left Join (cost=54.24..76.17 rows=31 width=622) (actual time=1.215..1.320 rows=5 loops=1)

  • Hash Cond: (np.id = npu.notificationpreferences_id)
  • Filter: ((u.id = npu.user_id) OR (((ua.authority_name)::text = (npr.authority_name)::text) AND (ua.unit_id = np.restaurantunit_id)) OR (((ua.authority_name)::text = ANY ('{ROLE_UNIT_MANAGER,ROLE_UNIT_ADMIN,ROLE_USER,ROLE_ACCOUNTANT}'::text[])) AND ((npa.actors)::text = 'ALL_USERS'::text) AND (ua.unit_id = np.restaurantunit_id) AND u.activated AND (u.retired_date IS NULL)))
  • Rows Removed by Filter: 55
4. 0.043 0.290 ↓ 1.9 60 1

Hash Join (cost=2.61..8.78 rows=31 width=1,013) (actual time=0.206..0.290 rows=60 loops=1)

  • Hash Cond: (ua.user_id = u.id)
5. 0.020 0.210 ↓ 1.9 60 1

Nested Loop (cost=1.16..7.24 rows=31 width=952) (actual time=0.152..0.210 rows=60 loops=1)

6. 0.010 0.162 ↓ 2.0 2 1

Nested Loop Left Join (cost=1.16..5.62 rows=1 width=818) (actual time=0.132..0.162 rows=2 loops=1)

  • Join Filter: (npr.notificationpreferences_id = np.id)
  • Rows Removed by Join Filter: 16
7. 0.006 0.140 ↓ 2.0 2 1

Nested Loop (cost=1.16..4.44 rows=1 width=700) (actual time=0.117..0.140 rows=2 loops=1)

  • Join Filter: (ru.concept_id = c.id)
  • Rows Removed by Join Filter: 8
8. 0.008 0.122 ↓ 2.0 2 1

Nested Loop (cost=1.16..3.33 rows=1 width=184) (actual time=0.105..0.122 rows=2 loops=1)

  • Join Filter: (np.restaurantunit_id = ru.id)
  • Rows Removed by Join Filter: 1
9. 0.045 0.086 ↓ 2.0 2 1

Hash Right Join (cost=1.16..2.27 rows=1 width=134) (actual time=0.080..0.086 rows=2 loops=1)

  • Hash Cond: (npa.notificationpreferences_id = np.id)
10. 0.015 0.015 ↑ 1.0 8 1

Seq Scan on t_notification_preferences_actors npa (cost=0.00..1.08 rows=8 width=126) (actual time=0.013..0.015 rows=8 loops=1)

11. 0.007 0.026 ↓ 2.0 2 1

Hash (cost=1.15..1.15 rows=1 width=16) (actual time=0.026..0.026 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 0.019 0.019 ↓ 2.0 2 1

Seq Scan on t_notification_preferences np (cost=0.00..1.15 rows=1 width=16) (actual time=0.017..0.019 rows=2 loops=1)

  • Filter: ((retired_date IS NULL) AND ((notification_type)::text = 'SALES'::text))
  • Rows Removed by Filter: 10
13. 0.028 0.028 ↑ 1.0 2 2

Seq Scan on t_restaurantunit ru (cost=0.00..1.03 rows=2 width=58) (actual time=0.014..0.014 rows=2 loops=2)

  • Filter: ((retired_date IS NULL) AND (((unit_status)::text <> ALL ('{CLOSED,FIRED,FAILED_TO_LAUNCH}'::text[])) OR (unit_status IS NULL)))
14. 0.012 0.012 ↑ 1.0 5 2

Seq Scan on t_concept c (cost=0.00..1.05 rows=5 width=524) (actual time=0.005..0.006 rows=5 loops=2)

15. 0.012 0.012 ↑ 1.0 8 2

Seq Scan on t_notification_preferences_roles npr (cost=0.00..1.08 rows=8 width=126) (actual time=0.005..0.006 rows=8 loops=2)

16. 0.028 0.028 ↑ 1.0 30 2

Seq Scan on t_user_authority ua (cost=0.00..1.31 rows=31 width=134) (actual time=0.011..0.014 rows=30 loops=2)

17. 0.014 0.037 ↑ 1.1 19 1

Hash (cost=1.20..1.20 rows=20 width=69) (actual time=0.037..0.037 rows=19 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
18. 0.023 0.023 ↑ 1.1 19 1

Seq Scan on t_user u (cost=0.00..1.20 rows=20 width=69) (actual time=0.018..0.023 rows=19 loops=1)

19. 0.000 0.003 ↓ 0.0 0 1

Hash (cost=28.50..28.50 rows=1,850 width=16) (actual time=0.003..0.003 rows=0 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 16kB
20. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on t_notification_preferences_user npu (cost=0.00..28.50 rows=1,850 width=16) (actual time=0.003..0.003 rows=0 loops=1)