Details
-
Task
-
Status: Closed (View Workflow)
-
P3
-
Resolution: Done
-
None
-
None
-
-
Core: Platform - Sprint 61, CP: ready for planning
-
5
-
Core: Platform
Description
Description
Currently FK searches are performed through a view that is configured in the schema.json. This view is not accounted for by CQLPG so it requires a hard-coded handling in the appropriate APIs (e.g in mod-inventory-storage it is used for instance searching when holding fields, like location or material type, are used for filtering). This is problematic because any SQL optimisations need to be implemented both the in the CQLPG and in the hard-coded code in mod-inventory-storage.
Also, currently the handling for instance_holding view in mod-inventory-storage is broken and generates queries that ignore the fulltext index for titles, see FOLIO-1920 for details.
Goal
Propose an approach where information about foreign key and their relations to the table being searched comes from schema.json and drives the SQL generation in CQLPG directly. This can have two different forms:
- use the existing schema.json information that is responsible for setting up views and generate queries that utilize those views directly in CQLPG. This might require more complex traverse of the table and view structure by CQLPG, based on what fields are included in the query (e.g when the query includes fields that are not contained within the base table specified when invoking CQLPG, CQLPG would have to find the required view and use that instead)
- redesign how the FK and relationship information is stored in schema.json and based on the information generate nested SQL queries directly in CQLPG not using views. This on the other hand will result in a more complex SQL query (nested)
Notes
Note 1: besides standard standard joins we also have a requirement for handling more complex relationships like MODINVSTOR-277 where we need additional logic to generate an overidden (effective) location value. This most likely not going to he handled in this issues but will require it's own dedicated handling. It should, however, to taken into account when designing the approach.
TestRail: Results
Attachments
Issue Links
- blocks
-
FOLIO-1934 RMB 25 release (performance, refactoring)
-
- Closed
-
-
MODINVSTOR-256 Improve performance of /instance-storage/instances?query=holdingsRecords.permanentLocationId=abc*
-
- Closed
-
- is duplicated by
-
CQLPG-35 use SELECT ... IN to optimize queries involving views/joins
-
- Closed
-
-
CQLPG-41 Implement foreign key searches
-
- Closed
-
- relates to
-
RMB-380 implement new approach for searching array-of-strings and array-of-objects fields
-
- Closed
-
-
RMB-391 Implement foreign key support for CQLPGJson Parser (two tables, parent->child)
-
- Closed
-
-
UIIN-143 Basic search: Search by barcode
-
- Closed
-
-
UXPROD-1623 Search by barcode
-
- Closed
-
-
FOLIO-1920 SPIKE: optimize query instance by location
-
- Closed
-
-
MODINVSTOR-277 SPIKE: filtering by Effective Location
-
- Open
-