Add indexes on patient appointment start_date_time and status columns…#163
Open
ojwanganto wants to merge 2 commits intoBahmni:masterfrom
Open
Add indexes on patient appointment start_date_time and status columns…#163ojwanganto wants to merge 2 commits intoBahmni:masterfrom
ojwanganto wants to merge 2 commits intoBahmni:masterfrom
Conversation
… to improve query performance
gsluthra
reviewed
Nov 28, 2024
gsluthra
reviewed
Nov 28, 2024
Contributor
Author
|
I have updated the PR. Please re-review @gsluthra |
Contributor
Author
rahu1ramesh
approved these changes
Feb 7, 2025
rahu1ramesh
requested changes
Feb 7, 2025
| </changeSet> | ||
| <changeSet author="bahmni-appointments" id="add_index_on_patient_appointment_start_date_time_202411281139"> | ||
| <comment>add index on patient_appointment start_date_time column</comment> | ||
| <createIndex indexName="patient_appointment_start_date_time_index" tableName="patient_appointment"> |
Contributor
There was a problem hiding this comment.
@ojwanganto Thank you for the update! The changeset correctly adds an index to the start_date_time column in the patient_appointment table. However, to prevent duplicate index creation errors, it would be best to include a precondition to check if the index already exists before creating it.
Please add the following precondition before the <createIndex> tag:
<preConditions onFail="MARK_RAN">
<not>
<indexExists indexName="patient_appointment_start_date_time_index" tableName="patient_appointment"/>
</not>
</preConditions>Adding a precondition would prevents redundant index creation, help avoid migration failures if the index already exists and will ensure safe and idempotent schema updates.
Could you please update the changeset accordingly? Let me know if you have any questions. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds indexes on start_date_time and status columns for improved query perfornance