explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FRqG

Settings
# exclusive inclusive rows x rows loops node
1. 29,198.376 494,589.868 ↓ 81.5 2,200 1

HashAggregate (cost=94.03..94.30 rows=27 width=1,995) (actual time=494,581.617..494,589.868 rows=2,200 loops=1)

  • Group Key: u.id, u.created_at, u.updated_at, u.username, u.password, u.last_login, u.is_active, u.is_superuser, u.email, u.created_by_id, u.updated_by_id, u.is_editor, u.client_id, u.contact_id, u.first_name, u.last_name, u.title
2. 42,522.217 465,391.492 ↓ 221,874.1 5,990,600 1

Append (cost=1.44..92.88 rows=27 width=1,995) (actual time=1.685..465,391.492 rows=5,990,600 loops=1)

3. 0.008 0.107 ↓ 0.0 0 1

Nested Loop (cost=1.44..19.93 rows=1 width=168) (actual time=0.107..0.107 rows=0 loops=1)

4. 0.006 0.099 ↓ 0.0 0 1

Nested Loop (cost=1.15..19.51 rows=1 width=32) (actual time=0.099..0.099 rows=0 loops=1)

5. 0.007 0.093 ↓ 0.0 0 1

Nested Loop (cost=0.86..19.12 rows=1 width=32) (actual time=0.093..0.093 rows=0 loops=1)

6. 0.007 0.086 ↓ 0.0 0 1

Nested Loop (cost=0.57..18.80 rows=1 width=48) (actual time=0.086..0.086 rows=0 loops=1)

7. 0.013 0.079 ↓ 0.0 0 1

Nested Loop (cost=0.14..10.35 rows=1 width=32) (actual time=0.079..0.079 rows=0 loops=1)

8. 0.049 0.049 ↑ 1.0 1 1

Index Only Scan using notifications_campaign_pkey on notifications_campaign c (cost=0.14..8.16 rows=1 width=16) (actual time=0.045..0.049 rows=1 loops=1)

  • Index Cond: (id = '06fe59d9-d6fc-40ca-81ab-a5a7fd5ef08b'::uuid)
  • Heap Fetches: 1
9. 0.017 0.017 ↓ 0.0 0 1

Seq Scan on notifications_campaign_extra_recipients cr (cost=0.00..2.17 rows=1 width=32) (actual time=0.017..0.017 rows=0 loops=1)

  • Filter: (campaign_id = '06fe59d9-d6fc-40ca-81ab-a5a7fd5ef08b'::uuid)
  • Rows Removed by Filter: 94
10. 0.000 0.000 ↓ 0.0 0

Index Only Scan using authx_group_pkey on authx_group g (cost=0.42..8.44 rows=1 width=16) (never executed)

  • Index Cond: (id = cr.group_id)
  • Heap Fetches: 0
11. 0.000 0.000 ↓ 0.0 0

Index Scan using authx_usergroup_group_id_b4444bfe on authx_usergroup ug (cost=0.29..0.32 rows=1 width=32) (never executed)

  • Index Cond: (group_id = g.id)
12. 0.000 0.000 ↓ 0.0 0

Index Scan using notifications_subscriptionpreferences_user_id_3bc48e9d on notifications_subscriptionpreferences sp (cost=0.29..0.38 rows=1 width=32) (never executed)

  • Index Cond: (user_id = ug.user_id)
  • Filter: (subscribed AND (campaign_id = '06fe59d9-d6fc-40ca-81ab-a5a7fd5ef08b'::uuid))
13. 0.000 0.000 ↓ 0.0 0

Index Scan using authx_user_pkey on authx_user u (cost=0.29..0.41 rows=1 width=168) (never executed)

  • Index Cond: (id = ug.user_id)
14. 89,260.904 422,869.168 ↓ 230,407.7 5,990,600 1

Nested Loop (cost=2.43..72.68 rows=26 width=168) (actual time=1.568..422,869.168 rows=5,990,600 loops=1)

  • Join Filter: (cp.product_id = p.id)
15. 42,817.352 279,692.864 ↓ 239,624.0 5,990,600 1

Nested Loop (cost=2.15..64.93 rows=25 width=200) (actual time=1.526..279,692.864 rows=5,990,600 loops=1)

16. 0.010 0.010 ↑ 1.0 1 1

Index Only Scan using notifications_campaign_pkey on notifications_campaign c_1 (cost=0.14..8.16 rows=1 width=16) (actual time=0.005..0.010 rows=1 loops=1)

  • Index Cond: (id = '06fe59d9-d6fc-40ca-81ab-a5a7fd5ef08b'::uuid)
  • Heap Fetches: 1
17. 85,006.688 236,875.502 ↓ 239,624.0 5,990,600 1

Nested Loop (cost=2.00..56.52 rows=25 width=232) (actual time=1.508..236,875.502 rows=5,990,600 loops=1)

18. 43,255.991 85,972.214 ↓ 230,407.7 5,990,600 1

Nested Loop (cost=1.72..48.46 rows=26 width=200) (actual time=1.472..85,972.214 rows=5,990,600 loops=1)

19. 35.828 531.223 ↓ 2,200.0 2,200 1

Nested Loop (cost=1.29..17.13 rows=1 width=216) (actual time=0.883..531.223 rows=2,200 loops=1)

20. 34.530 193.995 ↓ 2,200.0 2,200 1

Nested Loop (cost=0.87..16.08 rows=1 width=200) (actual time=0.835..193.995 rows=2,200 loops=1)

21. 36.953 113.265 ↓ 2,200.0 2,200 1

Nested Loop (cost=0.58..15.71 rows=1 width=200) (actual time=0.809..113.265 rows=2,200 loops=1)

22. 16.912 16.912 ↓ 2,200.0 2,200 1

Index Scan using notifications_subscriptionpreferences_campaign_id_dae53b23 on notifications_subscriptionpreferences sp_1 (cost=0.29..7.39 rows=1 width=32) (actual time=0.780..16.912 rows=2,200 loops=1)

  • Index Cond: (campaign_id = '06fe59d9-d6fc-40ca-81ab-a5a7fd5ef08b'::uuid)
  • Filter: subscribed
23. 59.400 59.400 ↑ 1.0 1 2,200

Index Scan using authx_user_pkey on authx_user u_1 (cost=0.29..8.31 rows=1 width=168) (actual time=0.022..0.027 rows=1 loops=2,200)

  • Index Cond: (id = sp_1.user_id)
24. 46.200 46.200 ↑ 1.0 1 2,200

Index Scan using authx_usergroup_user_id_b4f9d58f on authx_usergroup ug_1 (cost=0.29..0.37 rows=1 width=32) (actual time=0.016..0.021 rows=1 loops=2,200)

  • Index Cond: (user_id = u_1.id)
25. 301.400 301.400 ↑ 1.0 1 2,200

Index Only Scan using authx_group_pkey on authx_group g_1 (cost=0.42..1.04 rows=1 width=16) (actual time=0.131..0.137 rows=1 loops=2,200)

  • Index Cond: (id = ug_1.group_id)
  • Heap Fetches: 2200
26. 42,185.000 42,185.000 ↓ 2.5 2,723 2,200

Index Scan using authx_group_products_group_id_7de675da on authx_group_products gp (cost=0.43..20.57 rows=1,075 width=32) (actual time=0.702..19.175 rows=2,723 loops=2,200)

  • Index Cond: (group_id = g_1.id)
27. 65,896.600 65,896.600 ↑ 1.0 1 5,990,600

Index Scan using notifications_campaign_products_product_id_25aa08ba on notifications_campaign_products cp (cost=0.28..0.30 rows=1 width=32) (actual time=0.006..0.011 rows=1 loops=5,990,600)

  • Index Cond: (product_id = gp.product_id)
  • Filter: (campaign_id = '06fe59d9-d6fc-40ca-81ab-a5a7fd5ef08b'::uuid)
  • Rows Removed by Filter: 0
28. 53,915.400 53,915.400 ↑ 1.0 1 5,990,600

Index Only Scan using authx_product_pkey on authx_product p (cost=0.28..0.30 rows=1 width=16) (actual time=0.005..0.009 rows=1 loops=5,990,600)

  • Index Cond: (id = gp.product_id)
  • Heap Fetches: 5990600