explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 13FM

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 0.358 ↑ 9.0 1 1

Unique (cost=225.17..225.51 rows=9 width=622) (actual time=0.355..0.358 rows=1 loops=1)

2. 0.046 0.355 ↑ 4.5 2 1

Sort (cost=225.17..225.20 rows=9 width=622) (actual time=0.355..0.355 rows=2 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: 25kB
3. 0.017 0.309 ↑ 4.5 2 1

Hash Left Join (cost=157.71..225.03 rows=9 width=622) (actual time=0.306..0.309 rows=2 loops=1)

  • Hash Cond: (((ua.authority_name)::text = (npr_1.authority_name)::text) AND (ua.unit_id = np_1.restaurantunit_id))
  • Filter: ((u.id = npu.user_id) OR (((ua.authority_name)::text = (npr_1.authority_name)::text) AND (ua.unit_id = np_1.restaurantunit_id)))
  • Rows Removed by Filter: 30
4. 0.035 0.186 ↑ 58.5 32 1

Hash Join (cost=79.59..99.86 rows=1,872 width=768) (actual time=0.166..0.186 rows=32 loops=1)

  • Hash Cond: (ua.user_id = u.id)
5. 0.026 0.026 ↑ 15.0 32 1

Seq Scan on t_user_authority ua (cost=0.00..14.80 rows=480 width=134) (actual time=0.022..0.026 rows=32 loops=1)

6. 0.010 0.125 ↑ 3.9 20 1

Hash (cost=78.61..78.61 rows=78 width=642) (actual time=0.125..0.125 rows=20 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
7. 0.012 0.115 ↑ 3.9 20 1

Hash Right Join (cost=49.52..78.61 rows=78 width=642) (actual time=0.106..0.115 rows=20 loops=1)

  • Hash Cond: (npu.user_id = u.id)
8. 0.000 0.076 ↓ 0.0 0 1

Hash Left Join (cost=48.07..76.96 rows=78 width=582) (actual time=0.076..0.076 rows=0 loops=1)

  • Hash Cond: (np.id = npr.notificationpreferences_id)
9. 0.000 0.076 ↓ 0.0 0 1

Hash Left Join (cost=26.15..52.27 rows=29 width=590) (actual time=0.076..0.076 rows=0 loops=1)

  • Hash Cond: (np.id = npa.notificationpreferences_id)
10. 0.006 0.076 ↓ 0.0 0 1

Nested Loop (cost=4.22..29.39 rows=10 width=590) (actual time=0.075..0.076 rows=0 loops=1)

11. 0.006 0.050 ↓ 2.0 2 1

Nested Loop (cost=0.00..14.54 rows=1 width=582) (actual time=0.036..0.050 rows=2 loops=1)

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

Nested Loop (cost=0.00..13.43 rows=1 width=66) (actual time=0.017..0.026 rows=2 loops=1)

  • Join Filter: (np.restaurantunit_id = ru.id)
  • Rows Removed by Join Filter: 1
13. 0.010 0.010 ↓ 2.0 2 1

Seq Scan on t_notification_preferences np (cost=0.00..12.38 rows=1 width=16) (actual time=0.007..0.010 rows=2 loops=1)

  • Filter: ((retired_date IS NULL) AND ((notification_type)::text = 'SALES'::text))
  • Rows Removed by Filter: 12
14. 0.012 0.012 ↑ 1.0 2 2

Seq Scan on t_restaurantunit ru (cost=0.00..1.03 rows=2 width=58) (actual time=0.005..0.006 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)))
15. 0.018 0.018 ↑ 1.0 5 2

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

16. 0.004 0.020 ↓ 0.0 0 2

Bitmap Heap Scan on t_notification_preferences_user npu (cost=4.22..14.76 rows=9 width=16) (actual time=0.010..0.010 rows=0 loops=2)

  • Recheck Cond: (notificationpreferences_id = np.id)
17. 0.016 0.016 ↓ 0.0 0 2

Bitmap Index Scan on t_notification_preferences_user_pkey (cost=0.00..4.22 rows=9 width=0) (actual time=0.008..0.008 rows=0 loops=2)

  • Index Cond: (notificationpreferences_id = np.id)
18. 0.000 0.000 ↓ 0.0 0

Hash (cost=15.30..15.30 rows=530 width=8) (never executed)

19. 0.000 0.000 ↓ 0.0 0

Seq Scan on t_notification_preferences_actors npa (cost=0.00..15.30 rows=530 width=8) (never executed)

20. 0.000 0.000 ↓ 0.0 0

Hash (cost=15.30..15.30 rows=530 width=8) (never executed)

21. 0.000 0.000 ↓ 0.0 0

Seq Scan on t_notification_preferences_roles npr (cost=0.00..15.30 rows=530 width=8) (never executed)

22. 0.011 0.027 ↑ 1.0 20 1

Hash (cost=1.20..1.20 rows=20 width=60) (actual time=0.026..0.027 rows=20 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
23. 0.016 0.016 ↑ 1.0 20 1

Seq Scan on t_user u (cost=0.00..1.20 rows=20 width=60) (actual time=0.010..0.016 rows=20 loops=1)

24. 0.006 0.106 ↑ 39.0 2 1

Hash (cost=76.96..76.96 rows=78 width=126) (actual time=0.106..0.106 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
25. 0.005 0.100 ↑ 39.0 2 1

Hash Join (cost=48.07..76.96 rows=78 width=126) (actual time=0.080..0.100 rows=2 loops=1)

  • Hash Cond: (np_1.id = npr_1.notificationpreferences_id)
26. 0.022 0.085 ↑ 14.5 2 1

Hash Left Join (cost=26.15..52.27 rows=29 width=16) (actual time=0.067..0.085 rows=2 loops=1)

  • Hash Cond: (np_1.id = npa_1.notificationpreferences_id)
27. 0.006 0.050 ↑ 5.0 2 1

Nested Loop Left Join (cost=4.22..29.39 rows=10 width=16) (actual time=0.032..0.050 rows=2 loops=1)

28. 0.003 0.040 ↓ 2.0 2 1

Nested Loop (cost=0.00..14.54 rows=1 width=16) (actual time=0.028..0.040 rows=2 loops=1)

  • Join Filter: (ru_1.concept_id = c_1.id)
  • Rows Removed by Join Filter: 8
29. 0.004 0.031 ↓ 2.0 2 1

Nested Loop (cost=0.00..13.43 rows=1 width=24) (actual time=0.022..0.031 rows=2 loops=1)

  • Join Filter: (np_1.restaurantunit_id = ru_1.id)
  • Rows Removed by Join Filter: 1
30. 0.019 0.019 ↓ 2.0 2 1

Seq Scan on t_notification_preferences np_1 (cost=0.00..12.38 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: 12
31. 0.008 0.008 ↑ 1.0 2 2

Seq Scan on t_restaurantunit ru_1 (cost=0.00..1.03 rows=2 width=16) (actual time=0.003..0.004 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)))
32. 0.006 0.006 ↑ 1.0 5 2

Seq Scan on t_concept c_1 (cost=0.00..1.05 rows=5 width=8) (actual time=0.002..0.003 rows=5 loops=2)

33. 0.002 0.004 ↓ 0.0 0 2

Bitmap Heap Scan on t_notification_preferences_user npu_1 (cost=4.22..14.76 rows=9 width=8) (actual time=0.002..0.002 rows=0 loops=2)

  • Recheck Cond: (notificationpreferences_id = np_1.id)
34. 0.002 0.002 ↓ 0.0 0 2

Bitmap Index Scan on t_notification_preferences_user_pkey (cost=0.00..4.22 rows=9 width=0) (actual time=0.001..0.001 rows=0 loops=2)

  • Index Cond: (notificationpreferences_id = np_1.id)
35. 0.007 0.013 ↑ 66.2 8 1

Hash (cost=15.30..15.30 rows=530 width=8) (actual time=0.013..0.013 rows=8 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
36. 0.006 0.006 ↑ 66.2 8 1

Seq Scan on t_notification_preferences_actors npa_1 (cost=0.00..15.30 rows=530 width=8) (actual time=0.004..0.006 rows=8 loops=1)

37. 0.003 0.010 ↑ 53.0 10 1

Hash (cost=15.30..15.30 rows=530 width=126) (actual time=0.010..0.010 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
38. 0.007 0.007 ↑ 53.0 10 1

Seq Scan on t_notification_preferences_roles npr_1 (cost=0.00..15.30 rows=530 width=126) (actual time=0.005..0.007 rows=10 loops=1)