From 7b3699fc7fb37253797f99902b31eec76c529d54 Mon Sep 17 00:00:00 2001 From: khanhtc1202 Date: Thu, 1 Aug 2024 17:13:03 +0700 Subject: [PATCH] Remove deleted related MySQL application index Signed-off-by: khanhtc1202 --- pkg/datastore/mysql/ensurer/indexes.sql | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/datastore/mysql/ensurer/indexes.sql b/pkg/datastore/mysql/ensurer/indexes.sql index 6c3c800b7a..d711ded840 100644 --- a/pkg/datastore/mysql/ensurer/indexes.sql +++ b/pkg/datastore/mysql/ensurer/indexes.sql @@ -9,11 +9,6 @@ CREATE INDEX application_disabled_updated_at_desc ON Application (Disabled, Upda ALTER TABLE Application ADD COLUMN Name VARCHAR(50) GENERATED ALWAYS AS (data->>"$.name") VIRTUAL NOT NULL; CREATE INDEX application_name_updated_at_desc ON Application (Name, UpdatedAt DESC); --- index on `Deleted` and `CreatedAt` ASC --- TODO: Reconsider make this Deleted column as STORED GENERATED COLUMN -ALTER TABLE Application ADD COLUMN Deleted BOOL GENERATED ALWAYS AS (IF(data->>"$.deleted" = 'true', True, False)) VIRTUAL NOT NULL; -CREATE INDEX application_deleted_created_at_asc ON Application (Deleted, CreatedAt); - -- index on `Kind` ASC and `UpdatedAt` DESC ALTER TABLE Application ADD COLUMN Kind INT GENERATED ALWAYS AS (IFNULL(data->>"$.kind", 0)) VIRTUAL NOT NULL; CREATE INDEX application_kind_updated_at_desc ON Application (Kind, UpdatedAt DESC); @@ -32,6 +27,9 @@ CREATE INDEX application_piped_id_updated_at_desc ON Application (PipedId, Updat -- TODO: Should remove this statement after few releases. DROP INDEX application_piped_id ON Application; +-- TODO: Should remove this statement after few releases. +DROP INDEX application_deleted_created_at_asc ON Application; + -- -- Command table indexes --