explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZiJp

Settings
# exclusive inclusive rows x rows loops node
1. 3.126 539.010 ↑ 1.0 1 1

Aggregate (cost=65,202.99..65,203.00 rows=1 width=8) (actual time=539.010..539.010 rows=1 loops=1)

2. 535.884 535.884 ↑ 1.1 50,000 1

Index Scan using contacts_pkey on contacts (cost=0.44..65,059.35 rows=57,455 width=0) (actual time=0.021..535.884 rows=50,000 loops=1)

  • Index Cond: (company_id = (current_setting('nimble.company_id'::text))::bytea)
  • Filter: ((current_setting('nimble.view_all_contacts'::text))::boolean OR ((owner_id IS NOT NULL) AND (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: 66,382
Planning time : 0.519 ms
Execution time : 539.063 ms