From 2ccf07260b87f2cbb6833023c28ccfda325f3c71 Mon Sep 17 00:00:00 2001 From: Sean Klein Date: Fri, 30 Jul 2021 10:07:37 -0400 Subject: [PATCH] [sql] Index on ID of parent scope before name (Vpcs, NetworkInterface) --- omicron-common/src/sql/dbinit.sql | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/omicron-common/src/sql/dbinit.sql b/omicron-common/src/sql/dbinit.sql index d305ef13dab..9156a685381 100644 --- a/omicron-common/src/sql/dbinit.sql +++ b/omicron-common/src/sql/dbinit.sql @@ -262,8 +262,8 @@ CREATE TABLE omicron.public.Vpc ( ); CREATE UNIQUE INDEX ON omicron.public.Vpc ( - name, - project_id + project_id, + name ) WHERE time_deleted IS NULL; @@ -283,8 +283,8 @@ CREATE TABLE omicron.public.VpcSubnet ( /* Subnet and network interface names are unique per VPC, not project */ CREATE UNIQUE INDEX ON omicron.public.VpcSubnet ( - name, - vpc_id + vpc_id, + name ) WHERE time_deleted IS NULL; @@ -314,8 +314,8 @@ CREATE TABLE omicron.public.NetworkInterface ( */ CREATE UNIQUE INDEX ON omicron.public.NetworkInterface ( - name, - vpc_id + vpc_id, + name ) WHERE time_deleted IS NULL;