explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7xIm

Settings
# exclusive inclusive rows x rows loops node
1. 3.677 451.028 ↑ 1.0 1 1

Aggregate (cost=66,642.22..66,642.23 rows=1 width=8) (actual time=451.028..451.028 rows=1 loops=1)

2.          

Initplan (for Aggregate)

3. 0.008 0.008 ↑ 1.0 1 1

Function Scan on can_view_all_contacts (cost=0.01..0.02 rows=1 width=1) (actual time=0.007..0.008 rows=1 loops=1)

4. 3.217 447.343 ↓ 1.2 68,500 1

Result (cost=0.43..66,501.42 rows=56,312 width=0) (actual time=11.897..447.343 rows=68,500 loops=1)

  • One-Time Filter: ((current_setting('nimble.company_id'::text))::bytea = '\x4d670aba143e3287b9d4427a'::bytea)
5. 444.126 444.126 ↓ 1.2 68,500 1

Index Scan using contacts_pkey on contacts (cost=0.43..66,501.42 rows=56,312 width=0) (actual time=11.893..444.126 rows=68,500 loops=1)

  • Index Cond: (company_id = '\x4d670aba143e3287b9d4427a'::bytea)
  • Filter: ($0 OR (owner_id = (current_setting('nimble.user_id'::text))::bytea) OR (read_for_users && '{""\\x00""}'::bytea[]) OR (read_for_users && ARRAY[(current_setting('nimble.user_id'::text))::bytea]) OR (read_for_groups && (string_to_array(current_setting('nimble.group_ids'::text), ','::text))::bytea[]) OR (edit_for_users && ARRAY[(current_setting('nimble.user_id'::text))::bytea]) OR (edit_for_groups && (string_to_array(current_setting('nimble.group_ids'::text), ','::text))::bytea[]))
  • Rows Removed by Filter: 47,882
Planning time : 0.416 ms
Execution time : 451.106 ms