From 40b20ee797997d2cbdabf2d2514335b417f89629 Mon Sep 17 00:00:00 2001 From: Julian Jarminowski Date: Tue, 13 Aug 2024 16:54:42 +0200 Subject: [PATCH] fix: Remove duplicate database indices (#1024) * fix: Remove duplicate database indices * fix: Improve documentation --- CHANGELOG.md | 2 ++ .../migration/V12__DROP_duplicate_indices.sql | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 extensions/postgres-flyway/src/main/resources/db/migration/V12__DROP_duplicate_indices.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ab2c06b5..09e0442c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ please see [changelog_updates.md](docs/dev/changelog_updates.md). #### Patch Changes +- Improve database performance by removing duplicate indexes + ### Deployment Migration Notes #### Compatible Versions diff --git a/extensions/postgres-flyway/src/main/resources/db/migration/V12__DROP_duplicate_indices.sql b/extensions/postgres-flyway/src/main/resources/db/migration/V12__DROP_duplicate_indices.sql new file mode 100644 index 000000000..e1a8f3d46 --- /dev/null +++ b/extensions/postgres-flyway/src/main/resources/db/migration/V12__DROP_duplicate_indices.sql @@ -0,0 +1,21 @@ +-- +-- Copyright (c) 2024 sovity GmbH +-- +-- This program and the accompanying materials are made available under the +-- terms of the Apache License, Version 2.0 which is available at +-- https://www.apache.org/licenses/LICENSE-2.0 +-- +-- SPDX-License-Identifier: Apache-2.0 +-- +-- Contributors: +-- sovity GmbH - Improve database performance by removing duplicate indices +-- + +-- Drop the duplicate indexes if they exist for improved resource usage. +DROP INDEX IF EXISTS contract_agreement_id_uindex; +DROP INDEX IF EXISTS contract_negotiation_id_uindex; +DROP INDEX IF EXISTS data_request_id_uindex; +DROP INDEX IF EXISTS lease_lease_id_uindex; +DROP INDEX IF EXISTS edc_policydefinitions_id_uindex; +DROP INDEX IF EXISTS transfer_process_id_uindex; +