internal/db: add iam_scope indexes

These will help the iam_scope list queries
pull/4202/head
Johan Brandhorst-Satzkorn 2 years ago
parent eb78943cdb
commit 85ca909720

@ -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;
Loading…
Cancel
Save