explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Wat

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=20,748.06..20,748.12 rows=1 width=2,144) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Unique (cost=20,748.06..20,748.12 rows=1 width=2,144) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=20,748.06..20,748.06 rows=1 width=2,144) (actual rows= loops=)

  • Sort Key: aws_emailsendingsuppression.is_new DESC, aws_emailsendingsuppression.last_aws_suppression_update DESC, users_baseuser.id, users_baseuser.password, users_baseuser.last_login, users_baseuser.is_superuser, users_baseuser.first_name, users_baseuser.last_name, users_baseuser.email, users_baseuser.is_staff, users_baseuser.is_active, users_baseuser.date_joined, users_baseuser.created_at, users_baseuser.updated_at, users_baseuser.username, users_baseuser.secret_key, users_baseuser.is_admin, ((SubPlan 1)), ((SubPlan 2)), crm_clientprofile.id, crm_clientprofile.created_at, crm_clientprofile.updated_at, crm_clientprofile.created_by_id, crm_clientprofile.updated_by_id, crm_clientprofile.personal_statement, crm_clientprofile.title_id, crm_clientprofile.admin_comments, crm_clientprofile.job_title, crm_clientprofile.company_name, crm_clientprofile.country_id, crm_clientprofile.region_id, crm_clientprofile.address_1, crm_clientprofile.address_2, crm_clientprofile.city, crm_clientprofile.postcode, crm_clientprofile.state_or_province, crm_clientprofile.website, crm_clientprofile.phone, crm_clientprofile.fax, crm_clientprofile.mobile, crm_clientprofile.linkedin_profile, crm_clientprofile.email_type, crm_clientprofile.business_activity_id, crm_clientprofile.priority, crm_clientprofile.unsubscribed, crm_clientprofile.unsubscribed_at, crm_clientprofile.unsubscribed_method, crm_clientprofile.account_manager_id, crm_clientprofile.registration_type, crm_clientprofile.commodity, crm_clientprofile.industry_id, crm_clientprofile.sub_industry_id, crm_clientprofile.no_auto_emails, crm_clientprofile.is_corporate_master_profile, crm_clientprofile.corporate_master_account_id, crm_clientprofile."group", crm_clientprofile.group_articles_by, crm_clientprofile.energy_group, crm_clientprofile.group_energy_articles_by, crm_clientprofile.email_hash, crm_clientprofile.mobile_last_seen_at, crm_clientprofile.uses_mobile_app, crm_clientprofile.default_currency_id, crm_clientprofile.interested_in_events, crm_clientprofile.interested_in_news, crm_clientprofile.interested_in_reports, common_country.id, common_country.created_at, common_country.updated_at, common_country.created_by_id, common_country.updated_by_id, common_country.title, common_country.region_id, common_region.id, common_region.created_at, common_region.updated_at, common_region.created_by_id, common_region.updated_by_id, common_region.title, common_region.master_region_id, t3.id, t3.password, t3.last_login, t3.is_superuser, t3.first_name, t3.last_name, t3.email, t3.is_staff, t3.is_active, t3.date_joined, t3.created_at, t3.updated_at, t3.username, t3.secret_key, t3.is_admin, t4.id, t4.password, t4.last_login, t4.is_superuser, t4.first_name, t4.last_name, t4.email, t4.is_staff, t4.is_active, t4.date_joined, t4.created_at, t4.updated_at, t4.username, t4.secret_key, t4.is_admin
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,574.77..20,748.06 rows=1 width=2,144) (actual rows= loops=)

  • Join Filter: (aws_emailsendingsuppression.id = u0.id)
5. 0.000 0.000 ↓ 0.0

Index Scan using aws_emailsendingsuppression_batch_date_122c13c9 on aws_emailsendingsuppression u0 (cost=0.06..2.06 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (batch_date = '2020-02-12'::date)
6. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,574.71..20,706.98 rows=628 width=1,624) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,574.68..20,687.34 rows=628 width=1,076) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Gather (cost=1,574.65..20,666.29 rows=628 width=1,034) (actual rows= loops=)

  • Workers Planned: 1
9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=574.65..19,603.49 rows=369 width=1,034) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=574.57..19,544.76 rows=354 width=797) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=574.49..19,486.02 rows=354 width=556) (actual rows= loops=)

  • Filter: ((crm_clientprofile.account_manager_id = 301,104) OR (t5.account_manager_id = 301,104))
12. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=574.40..16,366.32 rows=16,172 width=556) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Hash Join (cost=574.32..13,683.13 rows=16,172 width=315) (actual rows= loops=)

  • Hash Cond: (crm_clientprofile.user_id = aws_emailsendingsuppression.client_id)
14. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on crm_clientprofile (cost=0.00..12,328.31 rows=154,103 width=298) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash (cost=473.45..473.45 rows=28,818 width=17) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Seq Scan on aws_emailsendingsuppression (cost=0.00..473.45 rows=28,818 width=17) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Index Scan using users_baseuser_pkey on users_baseuser t4 (cost=0.08..0.17 rows=1 width=241) (actual rows= loops=)

  • Index Cond: (crm_clientprofile.corporate_master_account_id = id)
18. 0.000 0.000 ↓ 0.0

Index Scan using crm_clientprofile_user_id_key on crm_clientprofile t5 (cost=0.08..0.19 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (t4.id = user_id)
19. 0.000 0.000 ↓ 0.0

Index Scan using users_baseuser_pkey on users_baseuser t3 (cost=0.08..0.17 rows=1 width=241) (actual rows= loops=)

  • Index Cond: (crm_clientprofile.account_manager_id = id)
20. 0.000 0.000 ↓ 0.0

Index Scan using users_baseuser_pkey on users_baseuser (cost=0.08..0.17 rows=1 width=241) (actual rows= loops=)

  • Index Cond: (id = crm_clientprofile.user_id)
21. 0.000 0.000 ↓ 0.0

Index Scan using common_country_pkey on common_country (cost=0.03..0.03 rows=1 width=42) (actual rows= loops=)

  • Index Cond: (crm_clientprofile.country_id = id)
22. 0.000 0.000 ↓ 0.0

Index Scan using common_region_pkey on common_region (cost=0.03..0.03 rows=1 width=548) (actual rows= loops=)

  • Index Cond: (crm_clientprofile.region_id = id)
23.          

SubPlan (for Nested Loop)

24. 0.000 0.000 ↓ 0.0

Limit (cost=18.41..18.41 rows=1 width=21) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Sort (cost=18.41..18.41 rows=9 width=21) (actual rows= loops=)

  • Sort Key: u0_1.created_at DESC
26. 0.000 0.000 ↓ 0.0

Index Scan using crm_clientprofilelog_client_id_a2e978d7 on crm_clientprofilelog u0_1 (cost=0.06..18.40 rows=9 width=21) (actual rows= loops=)

  • Index Cond: (client_id = users_baseuser.id)
27. 0.000 0.000 ↓ 0.0

Limit (cost=18.41..18.41 rows=1 width=8) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Sort (cost=18.41..18.41 rows=9 width=8) (actual rows= loops=)

  • Sort Key: u0_2.created_at DESC
29. 0.000 0.000 ↓ 0.0

Index Scan using crm_clientprofilelog_client_id_a2e978d7 on crm_clientprofilelog u0_2 (cost=0.06..18.40 rows=9 width=8) (actual rows= loops=)

  • Index Cond: (client_id = users_baseuser.id)