explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PUeP : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #xgHE - adds index on vendor_member.member_id; plan #WjD7; plan #Up22; plan #DYvS; plan #Uxnd; plan #bt9D; plan #cq1d; plan #riv; plan #GGAg; plan #j9yv; plan #obNc; plan #Q829; plan #cLJV; plan #KQub; plan #4o68; plan #kqii; plan #1vQo; plan #yBWv; plan #KLXs; plan #QuI

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.364 548.065 ↑ 31,647.0 1 1

Nested Loop (cost=0.85..668,067.77 rows=31,647 width=4) (actual time=545.611..548.065 rows=1 loops=1)

2. 0.251 1.629 ↓ 1.1 1,492 1

Nested Loop (cost=0.43..187.30 rows=1,369 width=4) (actual time=0.025..1.629 rows=1,492 loops=1)

3. 0.012 0.012 ↑ 1.0 1 1

Index Only Scan using uq_tenant_tenant_id_wex_key on tenant (cost=0.14..1.16 rows=1 width=4) (actual time=0.010..0.012 rows=1 loops=1)

  • Index Cond: (tenant_id = 40)
  • Heap Fetches: 1
4. 1.366 1.366 ↓ 1.1 1,492 1

Index Scan using uq_employer_tenant_id_wex_key on employer (cost=0.29..172.45 rows=1,369 width=8) (actual time=0.014..1.366 rows=1,492 loops=1)

  • Index Cond: (tenant_id = 40)
  • Filter: (archived IS FALSE)
  • Rows Removed by Filter: 4
5. 545.172 546.072 ↓ 0.0 0 1,492

Index Scan using member_employer_id on member (cost=0.42..487.40 rows=46 width=8) (actual time=0.365..0.366 rows=0 loops=1,492)

  • Index Cond: (employer_id = employer.employer_id)
  • Filter: ((deleted IS FALSE) AND (archived IS FALSE) AND (((email)::text ~~* '%Elizabeth Aaron%'::text) OR ((first_name)::text ~~* '%Elizabeth Aaron%'::text) OR ((last_name)::text ~~* '%Elizabeth Aaron%'::text) OR ((alegeus_key)::text ~~* '%Elizabeth Aaron%'::text) OR ((datapath_key)::text ~~* '%Elizabeth Aaron%'::text) OR ((wex_key)::text ~~* '%Elizabeth Aaron%'::text) OR ((ssn)::text ~~* '%Elizabeth Aaron%'::text) OR (alternatives: SubPlan 1 or hashed SubPlan 2) OR (((first_name)::text ~~* '%Elizabeth%'::text) AND ((last_name)::text ~~* '%Aaron%'::text))))
  • Rows Removed by Filter: 99
6.          

SubPlan (for Index Scan)

7. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.84..4.67 rows=1 width=0) (never executed)

8. 0.000 0.000 ↓ 0.0 0

Index Scan using member_policy_holder__member_id on member_policy_holder (cost=0.42..1.71 rows=2 width=4) (never executed)

  • Index Cond: (member.id = member_id)
9. 0.000 0.000 ↓ 0.0 0

Index Scan using policy_holder_pkey on policy_holder (cost=0.42..1.45 rows=1 width=4) (never executed)

  • Index Cond: (policy_holder_id = member_policy_holder.policy_holder_id)
  • Filter: (((first_name)::text ~~* '%Elizabeth Aaron%'::text) OR ((last_name)::text ~~* '%Elizabeth Aaron%'::text) OR ((username)::text ~~* '%Elizabeth Aaron%'::text) OR ((email)::text ~~* '%Elizabeth Aaron%'::text))
10. 0.001 0.900 ↓ 0.0 0 1

Nested Loop (cost=80.66..136.41 rows=27 width=4) (actual time=0.899..0.900 rows=0 loops=1)

11. 0.002 0.899 ↓ 0.0 0 1

Bitmap Heap Scan on policy_holder policy_holder_1 (cost=80.24..95.88 rows=28 width=4) (actual time=0.899..0.899 rows=0 loops=1)

  • Recheck Cond: (((first_name)::text ~~* '%Elizabeth Aaron%'::text) OR ((last_name)::text ~~* '%Elizabeth Aaron%'::text) OR ((username)::text ~~* '%Elizabeth Aaron%'::text) OR ((email)::text ~~* '%Elizabeth Aaron%'::text))
12. 0.001 0.897 ↓ 0.0 0 1

BitmapOr (cost=80.24..80.24 rows=28 width=0) (actual time=0.897..0.897 rows=0 loops=1)

13. 0.381 0.381 ↓ 0.0 0 1

Bitmap Index Scan on policy_holder_first_name_last_name_email_username_idx (cost=0.00..20.05 rows=7 width=0) (actual time=0.381..0.381 rows=0 loops=1)

  • Index Cond: ((first_name)::text ~~* '%Elizabeth Aaron%'::text)
14. 0.140 0.140 ↓ 0.0 0 1

Bitmap Index Scan on policy_holder_first_name_last_name_email_username_idx (cost=0.00..20.06 rows=8 width=0) (actual time=0.140..0.140 rows=0 loops=1)

  • Index Cond: ((last_name)::text ~~* '%Elizabeth Aaron%'::text)
15. 0.309 0.309 ↓ 0.0 0 1

Bitmap Index Scan on policy_holder_first_name_last_name_email_username_idx (cost=0.00..20.09 rows=12 width=0) (actual time=0.309..0.309 rows=0 loops=1)

  • Index Cond: ((username)::text ~~* '%Elizabeth Aaron%'::text)
16. 0.066 0.066 ↓ 0.0 0 1

Bitmap Index Scan on policy_holder_first_name_last_name_email_username_idx (cost=0.00..20.00 rows=1 width=0) (actual time=0.066..0.066 rows=0 loops=1)

  • Index Cond: ((email)::text ~~* '%Elizabeth Aaron%'::text)
17. 0.000 0.000 ↓ 0.0 0

Index Scan using member_policy_holder__policy_holder_id on member_policy_holder member_policy_holder_1 (cost=0.42..1.44 rows=1 width=8) (never executed)

  • Index Cond: (policy_holder_id = policy_holder_1.policy_holder_id)
Planning time : 3.068 ms
Execution time : 548.231 ms