[CIRCSTORE-114] Investigate and fix query open loan by item id Created: 07/Mar/19  Updated: 12/Mar/19  Resolved: 08/Mar/19

Status: Closed
Project: mod-circulation-storage
Components: None
Affects versions: None
Fix versions: 7.0.0

Type: Task Priority: P3
Reporter: Hongwei Ji Assignee: Hongwei Ji
Resolution: Done Votes: 0
Labels: platform-backlog
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Sprint: Core: Platform - Sprint 58
Story Points: 1
Development Team: Core: Platform

 Description   

It was reported by EBSCO that following query used by mod-rtac is slow. Investigate and fix.
/circulation/loans?limit=1&query=(itemId==x and status.name==Open)



 Comments   
Comment by Hongwei Ji [ 08/Mar/19 ]

The query generated cannot use the index. For example:

Query: SELECT COUNT(*) FROM supertenant_mod_circulation_storage.loan  WHERE (lower(f_unaccent(loan.jsonb->>'itemId')) LIKE lower(f_unaccent('00007443-1460-410e-bd22-305abf53ed6a'))) AND (lower(f_unaccent(loan.jsonb->'status'->>'name')) LIKE lower(f_unaccent('Open')))
Index: "loan_itemid_idx_unique" UNIQUE, btree (f_unaccent(jsonb ->> 'itemId'::text)) WHERE ((jsonb -> 'status'::text) ->> 'name'::text) = 'Open'::text
Comment by Hongwei Ji [ 08/Mar/19 ]

Move to the right project mod-circulation-storage and add fix version.

Generated at Thu Feb 08 23:16:23 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.