explain.depesz.com

PostgreSQL's explain analyze made readable

Result: i6YB : 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: 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; plan #PUeP

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.464 343.544 ↑ 48.9 651 1

Nested Loop (cost=0.85..665,986.89 rows=31,821 width=4) (actual time=1.211..343.544 rows=651 loops=1)

2. 0.196 1.412 ↓ 1.1 1,492 1

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

3. 0.010 0.010 ↑ 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.008..0.010 rows=1 loops=1)

  • Index Cond: (tenant_id = 40)
  • Heap Fetches: 1
4. 1.206 1.206 ↓ 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.013..1.206 rows=1,492 loops=1)

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

Index Scan using member_employer_id on member (cost=0.42..485.87 rows=47 width=8) (actual time=0.103..0.229 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 (alternatives: SubPlan 1 or hashed SubPlan 2) OR ((first_name)::text ~~* '%Elizabeth%'::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.831 ↓ 0.0 0 1

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

11. 0.001 0.830 ↓ 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.830..0.830 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.002 0.829 ↓ 0.0 0 1

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

13. 0.371 0.371 ↓ 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.371..0.371 rows=0 loops=1)

  • Index Cond: ((first_name)::text ~~* '%Elizabeth Aaron%'::text)
14. 0.121 0.121 ↓ 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.121..0.121 rows=0 loops=1)

  • Index Cond: ((last_name)::text ~~* '%Elizabeth Aaron%'::text)
15. 0.284 0.284 ↓ 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.284..0.284 rows=0 loops=1)

  • Index Cond: ((username)::text ~~* '%Elizabeth Aaron%'::text)
16. 0.051 0.051 ↓ 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.051..0.051 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 : 2.340 ms
Execution time : 343.768 ms