From 52e11b0d029c664c4964eb1791a6ce4f4baf335e Mon Sep 17 00:00:00 2001 From: Harsh Sawarkar Date: Thu, 20 Feb 2025 00:26:47 +0530 Subject: [PATCH 1/4] Added the new migration script for new index entity__type_id Signed-off-by: Harsh Sawarkar --- .../db/migration/v1/V1.104__drop_entity__id_type_index.sql | 3 +++ .../db/migration/v2/V2.9.0__drop_entity__id_type_index.sql | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104__drop_entity__id_type_index.sql create mode 100644 hedera-mirror-importer/src/main/resources/db/migration/v2/V2.9.0__drop_entity__id_type_index.sql diff --git a/hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104__drop_entity__id_type_index.sql b/hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104__drop_entity__id_type_index.sql new file mode 100644 index 00000000000..f285bf6959a --- /dev/null +++ b/hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104__drop_entity__id_type_index.sql @@ -0,0 +1,3 @@ +DROP INDEX IF EXISTS entity__id_type; + +CREATE INDEX entity__type_id ON entity(type, id); \ No newline at end of file diff --git a/hedera-mirror-importer/src/main/resources/db/migration/v2/V2.9.0__drop_entity__id_type_index.sql b/hedera-mirror-importer/src/main/resources/db/migration/v2/V2.9.0__drop_entity__id_type_index.sql new file mode 100644 index 00000000000..f285bf6959a --- /dev/null +++ b/hedera-mirror-importer/src/main/resources/db/migration/v2/V2.9.0__drop_entity__id_type_index.sql @@ -0,0 +1,3 @@ +DROP INDEX IF EXISTS entity__id_type; + +CREATE INDEX entity__type_id ON entity(type, id); \ No newline at end of file From 5de107ad0b7ec53e708ae1ad2b7e852a54385380 Mon Sep 17 00:00:00 2001 From: Harsh Sawarkar Date: Thu, 20 Feb 2025 00:30:43 +0530 Subject: [PATCH 2/4] Added the new migration script for new index entity__type_id Signed-off-by: Harsh Sawarkar --- .../db/migration/v1/V1.104__drop_entity__id_type_index.sql | 2 +- .../db/migration/v2/V2.9.0__drop_entity__id_type_index.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104__drop_entity__id_type_index.sql b/hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104__drop_entity__id_type_index.sql index f285bf6959a..bfc3097449a 100644 --- a/hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104__drop_entity__id_type_index.sql +++ b/hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104__drop_entity__id_type_index.sql @@ -1,3 +1,3 @@ DROP INDEX IF EXISTS entity__id_type; -CREATE INDEX entity__type_id ON entity(type, id); \ No newline at end of file +CREATE INDEX entity__type_id ON entity(type, id); diff --git a/hedera-mirror-importer/src/main/resources/db/migration/v2/V2.9.0__drop_entity__id_type_index.sql b/hedera-mirror-importer/src/main/resources/db/migration/v2/V2.9.0__drop_entity__id_type_index.sql index f285bf6959a..bfc3097449a 100644 --- a/hedera-mirror-importer/src/main/resources/db/migration/v2/V2.9.0__drop_entity__id_type_index.sql +++ b/hedera-mirror-importer/src/main/resources/db/migration/v2/V2.9.0__drop_entity__id_type_index.sql @@ -1,3 +1,3 @@ DROP INDEX IF EXISTS entity__id_type; -CREATE INDEX entity__type_id ON entity(type, id); \ No newline at end of file +CREATE INDEX entity__type_id ON entity(type, id); From 265bff790bfee991ce4c89a83edbda6a670e7db7 Mon Sep 17 00:00:00 2001 From: Harsh Sawarkar Date: Fri, 21 Feb 2025 23:32:55 +0530 Subject: [PATCH 3/4] Converted the SQL query to standard lowercase. Signed-off-by: Harsh Sawarkar --- .../db/migration/v1/V1.104__drop_entity__id_type_index.sql | 4 ++-- .../db/migration/v2/V2.9.0__drop_entity__id_type_index.sql | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104__drop_entity__id_type_index.sql b/hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104__drop_entity__id_type_index.sql index bfc3097449a..595cadeba7a 100644 --- a/hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104__drop_entity__id_type_index.sql +++ b/hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104__drop_entity__id_type_index.sql @@ -1,3 +1,3 @@ -DROP INDEX IF EXISTS entity__id_type; +drop index if exists entity__id_type; -CREATE INDEX entity__type_id ON entity(type, id); +create index entity__type_id on entity(type, id); diff --git a/hedera-mirror-importer/src/main/resources/db/migration/v2/V2.9.0__drop_entity__id_type_index.sql b/hedera-mirror-importer/src/main/resources/db/migration/v2/V2.9.0__drop_entity__id_type_index.sql index bfc3097449a..595cadeba7a 100644 --- a/hedera-mirror-importer/src/main/resources/db/migration/v2/V2.9.0__drop_entity__id_type_index.sql +++ b/hedera-mirror-importer/src/main/resources/db/migration/v2/V2.9.0__drop_entity__id_type_index.sql @@ -1,3 +1,3 @@ -DROP INDEX IF EXISTS entity__id_type; +drop index if exists entity__id_type; -CREATE INDEX entity__type_id ON entity(type, id); +create index entity__type_id on entity(type, id); From 54de2b6ace2389f301a8adcf1b15f7045726d0ae Mon Sep 17 00:00:00 2001 From: Harsh Sawarkar Date: Sat, 22 Feb 2025 13:27:18 +0530 Subject: [PATCH 4/4] Renamed the file. Signed-off-by: Harsh Sawarkar --- ...id_type_index.sql => V1.104.0__drop_entity__id_type_index.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename hedera-mirror-importer/src/main/resources/db/migration/v1/{V1.104__drop_entity__id_type_index.sql => V1.104.0__drop_entity__id_type_index.sql} (100%) diff --git a/hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104__drop_entity__id_type_index.sql b/hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104.0__drop_entity__id_type_index.sql similarity index 100% rename from hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104__drop_entity__id_type_index.sql rename to hedera-mirror-importer/src/main/resources/db/migration/v1/V1.104.0__drop_entity__id_type_index.sql