This is an automated email from the ASF dual-hosted git repository.

adamsaghy pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 9e15e459f0 FINERACT-2181: Remove suboptimal indexes
9e15e459f0 is described below

commit 9e15e459f04df2cbd6226079b713768b30e6c7b1
Author: Adam Saghy <[email protected]>
AuthorDate: Tue Jul 15 10:21:38 2025 +0200

    FINERACT-2181: Remove suboptimal indexes
---
 .../tenant/module/loan/module-changelog-master.xml |   2 +-
 .../module/loan/parts/1028_add_missing_indexes.xml | 132 ---------------------
 .../loan/parts/1028_remove_suboptimal_indexes.xml  |  56 +++++++++
 3 files changed, 57 insertions(+), 133 deletions(-)

diff --git 
a/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/module-changelog-master.xml
 
b/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/module-changelog-master.xml
index 16f44a8026..fc4f0c9f77 100644
--- 
a/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/module-changelog-master.xml
+++ 
b/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/module-changelog-master.xml
@@ -50,7 +50,7 @@
   <include relativeToChangelogFile="true" 
file="parts/1025_store_pre_closure_strategy_to_loan_level.xml"/>
   <include relativeToChangelogFile="true" 
file="parts/1026_add_interest_recognition_flag.xml"/>
   <include relativeToChangelogFile="true" 
file="parts/1027_add_capitalized_income_transaction_type.xml"/>
-  <include relativeToChangelogFile="true" 
file="parts/1028_add_missing_indexes.xml"/>
+  <include relativeToChangelogFile="true" 
file="parts/1028_remove_suboptimal_indexes.xml"/>
   <include relativeToChangelogFile="true" 
file="parts/1029_add_installment_amount_in_multiples_of_to_loan.xml"/>
   <include relativeToChangelogFile="true" 
file="parts/1030_add_loan_undo_contract_termination_event.xml"/>
 </databaseChangeLog>
diff --git 
a/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/parts/1028_add_missing_indexes.xml
 
b/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/parts/1028_add_missing_indexes.xml
deleted file mode 100644
index e952695914..0000000000
--- 
a/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/parts/1028_add_missing_indexes.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements. See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership. The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License. You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied. See the License for the
-    specific language governing permissions and limitations
-    under the License.
-
--->
-<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog";
-                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-                   
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog 
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd";>
-
-    <changeSet author="fineract" id="1-postgres" context="postgresql" 
runInTransaction="false">
-        <preConditions onFail="MARK_RAN">
-            <not>
-                <indexExists 
indexName="m_loan_transaction_transaction_type_enum_index"/>
-            </not>
-        </preConditions>
-        <sql>
-            CREATE INDEX CONCURRENTLY 
m_loan_transaction_transaction_type_enum_index
-                ON m_loan_transaction (transaction_type_enum);
-        </sql>
-    </changeSet>
-    <changeSet author="fineract" id="2-postgres" context="postgresql" 
runInTransaction="false">
-        <preConditions onFail="MARK_RAN">
-            <not>
-                <indexExists 
indexName="m_loan_transaction_transaction_date_index"/>
-            </not>
-        </preConditions>
-        <sql>
-            CREATE INDEX CONCURRENTLY m_loan_transaction_transaction_date_index
-                ON m_loan_transaction (transaction_date);
-        </sql>
-    </changeSet>
-    <changeSet author="fineract" id="3-postgres" context="postgresql" 
runInTransaction="false">
-        <preConditions onFail="MARK_RAN">
-            <not>
-                <indexExists 
indexName="m_loan_transaction_created_on_utc_index"/>
-            </not>
-        </preConditions>
-        <sql>
-            CREATE INDEX CONCURRENTLY m_loan_transaction_created_on_utc_index
-                ON m_loan_transaction (created_on_utc);
-        </sql>
-    </changeSet>
-    <changeSet author="fineract" id="4-postgres" context="postgresql" 
runInTransaction="false">
-        <preConditions onFail="MARK_RAN">
-            <not>
-                <indexExists indexName="m_loan_transaction_is_reversed_index"/>
-            </not>
-        </preConditions>
-        <sql>
-            CREATE INDEX CONCURRENTLY m_loan_transaction_is_reversed_index
-                ON m_loan_transaction (is_reversed);
-        </sql>
-    </changeSet>
-    <changeSet author="fineract" id="5-postgres" context="postgresql" 
runInTransaction="false">
-        <preConditions onFail="MARK_RAN">
-            <not>
-                <indexExists 
indexName="m_loan_transaction_submitted_on_date_index"/>
-            </not>
-        </preConditions>
-        <sql>
-            CREATE INDEX CONCURRENTLY 
m_loan_transaction_submitted_on_date_index
-                ON m_loan_transaction (submitted_on_date);
-        </sql>
-    </changeSet>
-
-    <changeSet author="fineract" id="1-mysql" context="mysql">
-        <preConditions onFail="MARK_RAN">
-            <not>
-                <indexExists 
indexName="m_loan_transaction_transaction_type_enum_index"/>
-            </not>
-        </preConditions>
-        <createIndex 
indexName="m_loan_transaction_transaction_type_enum_index" 
tableName="m_loan_transaction">
-            <column name="transaction_type_enum"/>
-        </createIndex>
-    </changeSet>
-    <changeSet author="fineract" id="2-mysql" context="postgresql" 
runInTransaction="false">
-        <preConditions onFail="MARK_RAN">
-            <not>
-                <indexExists 
indexName="m_loan_transaction_transaction_date_index"/>
-            </not>
-        </preConditions>
-        <createIndex indexName="m_loan_transaction_transaction_date_index" 
tableName="m_loan_transaction">
-            <column name="transaction_date"/>
-        </createIndex>
-    </changeSet>
-    <changeSet author="fineract" id="3-mysql" context="postgresql" 
runInTransaction="false">
-        <preConditions onFail="MARK_RAN">
-            <not>
-                <indexExists 
indexName="m_loan_transaction_created_on_utc_index"/>
-            </not>
-        </preConditions>
-        <createIndex indexName="m_loan_transaction_created_on_utc_index" 
tableName="m_loan_transaction">
-            <column name="created_on_utc"/>
-        </createIndex>
-    </changeSet>
-    <changeSet author="fineract" id="4-mysql" context="postgresql" 
runInTransaction="false">
-        <preConditions onFail="MARK_RAN">
-            <not>
-                <indexExists indexName="m_loan_transaction_is_reversed_index"/>
-            </not>
-        </preConditions>
-        <createIndex indexName="m_loan_transaction_is_reversed_index" 
tableName="m_loan_transaction">
-            <column name="is_reversed"/>
-        </createIndex>
-    </changeSet>
-    <changeSet author="fineract" id="5-mysql" context="postgresql" 
runInTransaction="false">
-        <preConditions onFail="MARK_RAN">
-            <not>
-                <indexExists 
indexName="m_loan_transaction_submitted_on_date_index"/>
-            </not>
-        </preConditions>
-        <createIndex indexName="m_loan_transaction_submitted_on_date_index" 
tableName="m_loan_transaction">
-            <column name="submitted_on_date"/>
-        </createIndex>
-    </changeSet>
-</databaseChangeLog>
diff --git 
a/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/parts/1028_remove_suboptimal_indexes.xml
 
b/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/parts/1028_remove_suboptimal_indexes.xml
new file mode 100644
index 0000000000..6dd4787ed4
--- /dev/null
+++ 
b/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/parts/1028_remove_suboptimal_indexes.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements. See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership. The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License. You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied. See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog";
+                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+                   
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog 
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd";>
+
+    <changeSet author="fineract" id="drop-index-1" runInTransaction="false">
+        <preConditions onFail="MARK_RAN">
+            <indexExists 
indexName="m_loan_transaction_transaction_type_enum_index"/>
+        </preConditions>
+        <dropIndex indexName="m_loan_transaction_transaction_type_enum_index" 
tableName="m_loan_transaction"/>
+    </changeSet>
+    <changeSet author="fineract" id="drop-index-2" runInTransaction="false">
+        <preConditions onFail="MARK_RAN">
+            <indexExists 
indexName="m_loan_transaction_transaction_date_index"/>
+        </preConditions>
+        <dropIndex indexName="m_loan_transaction_transaction_date_index" 
tableName="m_loan_transaction"/>
+    </changeSet>
+    <changeSet author="fineract" id="drop-index-3" runInTransaction="false">
+        <preConditions onFail="MARK_RAN">
+            <indexExists indexName="m_loan_transaction_created_on_utc_index"/>
+        </preConditions>
+        <dropIndex indexName="m_loan_transaction_created_on_utc_index" 
tableName="m_loan_transaction"/>
+    </changeSet>
+    <changeSet author="fineract" id="drop-index-4" runInTransaction="false">
+        <preConditions onFail="MARK_RAN">
+            <indexExists indexName="m_loan_transaction_is_reversed_index"/>
+        </preConditions>
+        <dropIndex indexName="m_loan_transaction_is_reversed_index" 
tableName="m_loan_transaction"/>
+    </changeSet>
+    <changeSet author="fineract" id="drop-index-5" runInTransaction="false">
+        <preConditions onFail="MARK_RAN">
+            <indexExists 
indexName="m_loan_transaction_submitted_on_date_index"/>
+        </preConditions>
+        <dropIndex indexName="m_loan_transaction_submitted_on_date_index" 
tableName="m_loan_transaction"/>
+    </changeSet>
+</databaseChangeLog>

Reply via email to