Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (cache/db): add indexes for desktop queries #5091

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions internal/clientcache/internal/db/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ create table if not exists target (
primary key (fk_user_id, id)
);

-- index for implicit scope search
create index target_scope_id_ix on target(scope_id);

-- session contains cached boundary session resource for a specific user and
-- with specific fields extracted to facilitate searching over those fields
create table if not exists session (
Expand Down Expand Up @@ -190,6 +193,9 @@ create table if not exists session (
primary key (fk_user_id, id)
);

-- implicit scope search
create index session_scope_id_ix on session(scope_id);

-- alias contains cached boundary alias resource for a specific user and
-- with specific fields extracted to facilitate searching over those fields
create table if not exists resolvable_alias (
Expand All @@ -211,6 +217,9 @@ create table if not exists resolvable_alias (
primary key (fk_user_id, id)
);

-- optimize query for destination_id
create index destination_id_resolvable_alias_ix on resolvable_alias(destination_id);

-- contains errors from the last attempt to sync data from boundary for a
-- specific resource type
create table if not exists api_error (
Expand Down
Loading