explain.depesz.com

PostgreSQL's explain analyze made readable

Result: L3Ad

Settings
# exclusive inclusive rows x rows loops node
1. 68.193 1,566.743 ↑ 1.0 1 1

Aggregate (cost=178,864.74..178,864.75 rows=1 width=8) (actual time=1,566.742..1,566.743 rows=1 loops=1)

2.          

Initplan (for Aggregate)

3. 0.035 0.035 ↑ 1.0 1 1

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

4. 1,393.197 1,498.515 ↓ 1.9 1,052,168 1

Bitmap Heap Scan on contacts (cost=8,502.35..177,508.87 rows=542,342 width=0) (actual time=114.022..1,498.515 rows=1,052,168 loops=1)

  • Recheck Cond: (company_id = (current_setting('nimble.company_id'::text))::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[]))
  • Heap Blocks: exact=49,782
5. 105.318 105.318 ↑ 1.0 1,052,168 1

Bitmap Index Scan on ix_company_rls_permissions (cost=0.00..8,366.77 rows=1,058,368 width=0) (actual time=105.318..105.318 rows=1,052,168 loops=1)

  • Index Cond: (company_id = (current_setting('nimble.company_id'::text))::bytea)
Planning time : 0.679 ms
Execution time : 1,567.754 ms