Skip to content

Report duplicate and overlapping database indices#6989

Merged
labkey-adam merged 6 commits intodevelopfrom
fb_overlapping_indices
Sep 4, 2025
Merged

Report duplicate and overlapping database indices#6989
labkey-adam merged 6 commits intodevelopfrom
fb_overlapping_indices

Conversation

@labkey-adam
Copy link
Copy Markdown
Contributor

@labkey-adam labkey-adam commented Sep 2, 2025

Rationale

New devtools action inspects all indexes in tables in module schemas and flags those with duplicate or overlapping column sets. In most (all?) cases these duplicates are unnecessary, causing bloat and perhaps inefficiency.

Move standard redirect methods and callers away from passing URL strings.

Tasks 📍

Comment thread devtools/src/org/labkey/devtools/ToolsController.java Outdated
Comment thread devtools/src/org/labkey/devtools/ToolsController.java Outdated
Comment thread devtools/src/org/labkey/devtools/DevtoolsContainerListener.java
Comment thread devtools/src/org/labkey/devtools/DevtoolsManager.java
Copy link
Copy Markdown
Contributor

@labkey-matthewb labkey-matthewb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems useful. Some overlapping indexes are not redundant. If you want index (RowId, Other) I don't think you can the (RowId) part is unique. So you end up with two indexes.

@labkey-adam
Copy link
Copy Markdown
Contributor Author

labkey-adam commented Sep 3, 2025

Seems useful. Some overlapping indexes are not redundant. If you want index (RowId, Other) I don't think you can the (RowId) part is unique. So you end up with two indexes.

@labkey-matthewb see my most recent commit (committed earlier this morning)... it separates out a third group of valid overlaps: any PK or UQ index with a column list that's a subset of a non-unique index's column list. I think those are valid and all others are redundant, but please check my logic.

@labkey-adam labkey-adam merged commit 5d82167 into develop Sep 4, 2025
7 of 8 checks passed
@labkey-adam labkey-adam deleted the fb_overlapping_indices branch September 4, 2025 19:06
@labkey-adam labkey-adam mentioned this pull request Sep 5, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants