From e770ba8e0e3e33496fb31807b5919eb2ecd1b254 Mon Sep 17 00:00:00 2001 From: Siddhant <86899184+Siddhanttimeline@users.noreply.github.com> Date: Thu, 5 Dec 2024 04:44:31 +0530 Subject: [PATCH] FIX: Combined index on offset and eventTime in changeEvent table (#18922) * fix: combined index on offset and eventTime in changeEvent table * fix: correct syntax error in Postgres query. * fix: correct syntax error in Postgres query. * fix: correct syntax error in Postgres query. --- .../native/1.6.0/mysql/postDataMigrationSQLScript.sql | 6 +++++- .../native/1.6.0/postgres/postDataMigrationSQLScript.sql | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bootstrap/sql/migrations/native/1.6.0/mysql/postDataMigrationSQLScript.sql b/bootstrap/sql/migrations/native/1.6.0/mysql/postDataMigrationSQLScript.sql index 00c9ccbb089..722a99f1a6a 100644 --- a/bootstrap/sql/migrations/native/1.6.0/mysql/postDataMigrationSQLScript.sql +++ b/bootstrap/sql/migrations/native/1.6.0/mysql/postDataMigrationSQLScript.sql @@ -56,4 +56,8 @@ where serviceType in ('Snowflake', 'Redshift', 'BigQuery'); -- Update all rows in the consumers_dlq table to set the source column to 'publisher' UPDATE consumers_dlq SET source = 'publisher'; -DELETE from event_subscription_entity where name = "ActivityFeedAlert"; \ No newline at end of file +DELETE from event_subscription_entity where name = "ActivityFeedAlert"; + +DROP INDEX event_time_index ON change_event; + +CREATE INDEX idx_offset_event_time ON change_event (offset, eventTime); \ No newline at end of file diff --git a/bootstrap/sql/migrations/native/1.6.0/postgres/postDataMigrationSQLScript.sql b/bootstrap/sql/migrations/native/1.6.0/postgres/postDataMigrationSQLScript.sql index 807d1e95706..11f77cca785 100644 --- a/bootstrap/sql/migrations/native/1.6.0/postgres/postDataMigrationSQLScript.sql +++ b/bootstrap/sql/migrations/native/1.6.0/postgres/postDataMigrationSQLScript.sql @@ -72,4 +72,8 @@ WHERE serviceType IN ('Snowflake', 'Redshift', 'BigQuery'); -- Update all rows in the consumers_dlq table to set the source column to 'publisher' UPDATE consumers_dlq SET source = 'publisher'; -DELETE from event_subscription_entity where name = 'ActivityFeedAlert'; \ No newline at end of file +DELETE from event_subscription_entity where name = 'ActivityFeedAlert'; + +DROP INDEX IF EXISTS event_time_index; + +CREATE INDEX idx_offset_event_time ON change_event ("offset", eventTime); \ No newline at end of file