Skip to content

Comments

[MODORDSTOR-407] Optimized db indices#580

Open
damien-git wants to merge 6 commits intomasterfrom
MODORDSTOR-407
Open

[MODORDSTOR-407] Optimized db indices#580
damien-git wants to merge 6 commits intomasterfrom
MODORDSTOR-407

Conversation

@damien-git
Copy link
Contributor

@damien-git damien-git commented Feb 18, 2026

Purpose

Approach

  • Defined the following guidance to create indices and applied it.
  • Optimized indices, added new ones if needed, removed unnecessary ones. Replaced ginIndex by index or fullTextIndex whenever possible.
  • Sorted indices alphabetically.

Note: there are going to be warnings for acqUnitIds queries. We could add an index that removes these warnings, but if we use it, execution will not use the index resulting in a performance hit. Instead a custom index is used, but RMB does not detect it and generates a warning:

WARN CQL2PgJSON Doing LIKE search without index for titles.jsonb->>'acqUnitIds', CQL >>> SQL: acqUnitIds <> [] >>> lower(f_unaccent(titles.jsonb->>'acqUnitIds')) NOT LIKE lower(f_unaccent('[]'))

Removed indices

  • closeReason.note
  • comment
  • contributors
  • details.productIds
  • displaySummary
  • format
  • location.holdingId
  • location.locationId
  • physical.volumes
  • receivedDate
  • receivingStatus
  • renewal.manualRenewal
  • renewal.renewalDate
  • renewal.reviewPeriod
  • searchLocationIds
  • supplement
  • tags

Added indices

  • acquisitionMethod
  • billTo
  • contributorName
  • keyword
  • lastEDIExportDate
  • metadata.updatedByUserId
  • metadata.updatedDate
  • ongoing.isSubscription
  • packagePoLineId
  • physicalVolumes
  • poLineNumber
  • poNumber
  • poNumberPrefix
  • poNumberSuffix
  • searchLocations
  • shipTo
  • tags.tagList
  • vendorDetail.vendorAccount

Related PR

Related tickets

RMB indices Cheat-sheet

Moved to a wiki

DONE

  • Dennis will check with SIG group if poNumber/poLineNumber/vendorAccount/referenceNumbers can use exact searches.

Pre-Review Checklist

  • Self-reviewed Code — Reviewed code for issues, unnecessary parts, and overall quality.
  • Change Notes — NEWS.md updated with clear description and issue key.
  • Testing — Confirmed changes were tested locally or on dev environment.
  • Logging: Confirmed that logging is appropriately handled.
  • Breaking Changes — Handled all required actions if changes affect API, DB, or interface versions.
    • API/schema changes
    • Interface version updates
    • DB schema changes / migration scripts
  • New Properties / Environment Variables — Updated README.md if new configs were added.

@sonarqubecloud
Copy link

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.

1 participant