internal/db: add iam_scope indexes

These will help the iam_scope list queries
This commit is contained in:
Johan Brandhorst-Satzkorn committed 2024-01-05 07:43:21 -08:00
1 parent eb78943cdb
commit 85ca909720
2 files changed
+18

No files matched your search

@@ -22,4 +22,10 @@ begin;
on iam_group (update_time desc, public_id desc);
analyze iam_group;
create index iam_scope_create_time_public_id_idx
on iam_scope (create_time desc, public_id desc);
create index iam_scope_update_time_public_id_idx
on iam_scope (update_time desc, public_id desc);
analyze iam_scope;
commit;
@@ -0,0 +1,12 @@
-- Copyright (c) HashiCorp, Inc.
-- SPDX-License-Identifier: BUSL-1.1
begin;
select plan(2);
select has_index('iam_scope', 'iam_scope_create_time_public_id_idx', array['create_time', 'public_id']);
select has_index('iam_scope', 'iam_scope_update_time_public_id_idx', array['update_time', 'public_id']);
select * from finish();
rollback;