Add effectiveLocation.name to GET /holdings-storage/holdings?query=… search result
Description
Environment
Potential Workaround
relates to
Checklist
hideActivity

Julian Ladisch February 4, 2025 at 5:35 PM
mod-inventory APIs can add the location name to the result set, but usually they cannot sort on the location name because mod-inventory passes the request to mod-inventory-storage and sorting is handled by mod-inventory-storage. mod-inventory APIs can sort by location name if all records (ignoring offset and limit) are loaded into mod-inventory’s memory and sorted in memory. There can be millions of matching holdings records.
Zak Burke February 3, 2025 at 2:45 PM
This is an interesting, fascinating, and thorough technical explanation of “why this API performs in unexpected ways”. Thank you, ! But the unexpectedness of this API remains, and IMO that is the real problem here. You have solved a problem by flouting convention, and thus created another problem as a knock-on effect.
In fact, the UI does display the location-name, so probably the best approach is to follow the advice in the description and use mod-inventory or mod-search APIs to retrieve the necessary fields in a predictable fashion. I do not generally work in ui-inventory, that’s Folijet’s domain, so I will let (their tech lead) decide if the friction from this API is bothersome enough to open a ticket there to use a different API, or just handle the sort client-side.
I’m fine closing this as “Won’t do”, but I appreciate you taking the time and effort to explain the situation.

Julian Ladisch February 3, 2025 at 2:12 PM
We do not join the holdings table and the location table unconditionally to get the best performance.
Use mod-inventory APIs or mod-search APIs if you need the location name in the result set.
RMB only partially supports table joins:
CQL doesn’t support the join condition (the SQL ON clause), and joins may result in full table scans and should be avoided in most cases.
Therefore most joins require hand-written SQL and doesn’t support all queries but only a specific use case that is known not to result in a table scan. One example is .
It requires a rewrite of RMB’s CQL implementation if the location name should be supported in the query and returned in the result set; this requires too much development work. Therefore I suggest to close this as “Won’t do”.
Regarding = https://github.com/folio-org/mod-inventory-storage/pull/1128/files, copied from https://github.com/folio-org/ui-inventory/pull/2720#issuecomment-2630771429 :