fix: correct index mapping in electric_power_quality_summaries table #44
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.
Summary
Fixes incorrect index mapping in the
electric_power_quality_summariestable whereidx_epqs_summary_interval_startwas indexing theidcolumn instead of thesummary_interval_startcolumn.Root Cause
This issue was introduced in commit d5e321b when uuid columns were removed and replaced with id PRIMARY KEY columns. During the migration, one index was incorrectly remapped:
Before (incorrect):
After uuid removal (still incorrect):
Fixed (correct):
Changes
openespi-common/src/main/resources/db/migration/V3__Create_additiional_Base_Tables.sqlsummary_interval_startcolumnAnalysis of UUID Index Removals
Commit d5e321b removed 25 uuid indexes across V1 and V3 migrations:
id CHAR(36) PRIMARY KEYwhich automatically creates an indexidx_epqs_summary_interval_startwas indexing wrong columnTesting
summary_interval_startcolumnImpact
Queries filtering by
summary_interval_startwill now properly use this index for improved performance.Related Issues
TestContainers Issue (not addressed in this PR):
🤖 Generated with Claude Code