explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PGPi

Settings
# exclusive inclusive rows x rows loops node
1. 64.342 1,464.141 ↑ 1.0 1 1

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

2.          

Initplan (for Aggregate)

3. 0.039 0.039 ↑ 1.0 1 1

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

4. 1,319.078 1,399.760 ↓ 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=88.091..1,399.760 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. 80.682 80.682 ↑ 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=80.682..80.682 rows=1,052,168 loops=1)

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