Skip to content

Conversation

@labkey-adam
Copy link
Contributor

Rationale

Our utility has pointed out some redundant indices in ms2, luminex, and prot

Copy link
Contributor

@labkey-jeckels labkey-jeckels left a comment

Choose a reason for hiding this comment

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

See comment on Luminex Postgres index. Otherwise, tested and looks good.

Comment on lines +3 to +4
-- This index overlaps with uq_analyte_lsid
DROP INDEX luminex.ix_luminexdatarow_lsid;
Copy link
Contributor

Choose a reason for hiding this comment

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

uq_analyte_lsid is on a different table. luminex.analyte vs luminex.datarow. Am I missing something?

Copy link
Contributor Author

@labkey-adam labkey-adam Oct 3, 2025

Choose a reason for hiding this comment

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

Yes, it's confusing... but if you look at the PostgreSQL luminex-0.000-23.000.sql script, you'll see:

CREATE INDEX IX_LuminexDataRow_LSID ON luminex.Analyte (LSID);

Based on the name and the fact that the SQL Server script has:

CREATE INDEX IX_LuminexDataRow_LSID ON luminex.DataRow (LSID);

...I concluded that the PostgreSQL definition is flat-out wrong. That's why the new incremental script recreates this index (correctly) after the drop statements. Also why there are six index drops on SQL Server and seven on PostgreSQL (that was my first clue that something must be off).

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, interesting. I saw that the scripts were different in this PR but didn't realize it was because the original script was wrong.

Yes, this seems like the correct fixup now. I swear that I saw IX_LuminexDataRow_LSID on datarow when looking directly in the DB, but maybe I was just checking the SQLServer side.

@labkey-adam labkey-adam self-assigned this Oct 3, 2025
Comment on lines +3 to +4
-- This index overlaps with uq_analyte_lsid
DROP INDEX luminex.ix_luminexdatarow_lsid;
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, interesting. I saw that the scripts were different in this PR but didn't realize it was because the original script was wrong.

Yes, this seems like the correct fixup now. I swear that I saw IX_LuminexDataRow_LSID on datarow when looking directly in the DB, but maybe I was just checking the SQLServer side.

@labkey-adam labkey-adam merged commit 5728827 into develop Oct 3, 2025
12 checks passed
@labkey-adam labkey-adam deleted the fb_indices branch October 3, 2025 22:24
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.

3 participants