explain.depesz.com

PostgreSQL's explain analyze made readable

Result: H6oz3

Settings

Optimization(s) for this plan:

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

Unique (cost=66,585.03..66,585.18 rows=2 width=320) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=66,585.03..66,585.04 rows=2 width=320) (actual rows= loops=)

  • Sort Key: b.account_id, ac_1.contact_id, b.tp_account_id, b.is_approved, b.master_denetwork_ts, b.is_default_master, b.sproutkey, a_1.company_name, ac_1.user_id, ac_1.full_name, ac_1.first_name, ac_1.middle_name, ac_1.last_name, ac_1.affiliation, aa_1.address1, aa_1.address2, aa_1.city, aa_1.region_code, aa_1.postal_code, aa_1.country_code, ae_1.email_address, ap_1.phone_number, a_1.is_active, c.acct_group_id, xa2.last_login_ts, b.order_requires_approval, cc.currency_symbol, cc.currency_code
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=66,353.66..66,585.02 rows=2 width=320) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=66,353.37..66,581.02 rows=1 width=273) (actual rows= loops=)

  • Join Filter: ((aa.currency_code)::text = (cc.currency_code)::text)
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=66,353.37..66,577.11 rows=10 width=271) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=66,352.96..66,571.55 rows=11 width=282) (actual rows= loops=)

  • Join Filter: ((ac_1.contact_id)::bpchar = (aa_1.contact_id)::bpchar)
7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=66,352.54..66,565.37 rows=12 width=216) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=66,352.12..66,551.17 rows=14 width=188) (actual rows= loops=)

  • Join Filter: ((a_1.account_id)::bpchar = (ac_1.account_id)::bpchar)
9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=66,351.70..66,393.00 rows=14 width=146) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=66,351.42..66,387.25 rows=14 width=125) (actual rows= loops=)

  • Join Filter: ((b.account_id)::bpchar = (a_1.account_id)::bpchar)
11. 0.000 0.000 ↓ 0.0

Merge Join (cost=66,351.13..66,378.92 rows=15 width=89) (actual rows= loops=)

  • Merge Cond: ((b.account_id)::bpchar = (xa2.account_id)::bpchar)
12. 0.000 0.000 ↓ 0.0

Sort (cost=44.01..44.09 rows=32 width=64) (actual rows= loops=)

  • Sort Key: b.account_id
13. 0.000 0.000 ↓ 0.0

Index Scan using ix_rel_masters_accounts_master_account_id on rel_masters_accounts b (cost=0.29..43.21 rows=32 width=64) (actual rows= loops=)

  • Index Cond: ((master_account_id)::bpchar = 'AC15100025754944'::bpchar)
  • Filter: is_active
14. 0.000 0.000 ↓ 0.0

Sort (cost=66,307.12..66,320.85 rows=5,495 width=25) (actual rows= loops=)

  • Sort Key: xa2.account_id
15. 0.000 0.000 ↓ 0.0

Subquery Scan on xa2 (cost=65,855.87..65,965.77 rows=5,495 width=25) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

HashAggregate (cost=65,855.87..65,910.82 rows=5,495 width=25) (actual rows= loops=)

  • Group Key: a.account_id
17. 0.000 0.000 ↓ 0.0

Seq Scan on acct_contacts a (cost=0.00..65,176.58 rows=135,858 width=25) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Index Scan using ix_acct_accounts_account_id on acct_accounts a_1 (cost=0.29..0.54 rows=1 width=36) (actual rows= loops=)

  • Index Cond: ((account_id)::bpchar = (xa2.account_id)::bpchar)
  • Filter: ((role_name)::text = 'members'::text)
19. 0.000 0.000 ↓ 0.0

Index Scan using ix_acct_accounts_account_id on acct_accounts aa (cost=0.29..0.41 rows=1 width=21) (actual rows= loops=)

  • Index Cond: ((account_id)::bpchar = (a_1.account_id)::bpchar)
20. 0.000 0.000 ↓ 0.0

Index Scan using ix_acct_contacts_account_id on acct_contacts ac_1 (cost=0.42..11.27 rows=2 width=110) (actual rows= loops=)

  • Index Cond: ((account_id)::bpchar = (aa.account_id)::bpchar)
  • Filter: ((contact_type)::text = 'Primary'::text)
21. 0.000 0.000 ↓ 0.0

Index Scan using pk_acct_phones on acct_phones ap_1 (cost=0.42..1.01 rows=1 width=28) (actual rows= loops=)

  • Index Cond: (((contact_id)::bpchar = (ac_1.contact_id)::bpchar) AND ((phone_type)::text = 'Primary'::text))
22. 0.000 0.000 ↓ 0.0

Index Scan using pk_acct_addresses on acct_addresses aa_1 (cost=0.42..0.50 rows=1 width=66) (actual rows= loops=)

  • Index Cond: (((contact_id)::bpchar = (ap_1.contact_id)::bpchar) AND ((address_type)::text = 'Primary'::text))
23. 0.000 0.000 ↓ 0.0

Index Scan using ix_acct_e_info_contact_id on acct_e_info ae_1 (cost=0.42..0.51 rows=1 width=40) (actual rows= loops=)

  • Index Cond: ((contact_id)::bpchar = (aa_1.contact_id)::bpchar)
  • Filter: ((e_info_type)::text = 'Primary'::text)
24. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..2.13 rows=9 width=6) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Seq Scan on lookup_currencies cc (cost=0.00..2.09 rows=9 width=6) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Index Scan using ix_rel_acct_groups_accts_account_id on rel_acct_groups_accts c (cost=0.29..3.99 rows=1 width=34) (actual rows= loops=)

  • Index Cond: ((b.account_id)::bpchar = (account_id)::bpchar)