MODINVSTOR-1528 Add indexes for instance note fields#1316
MODINVSTOR-1528 Add indexes for instance note fields#1316mweaver-ebsco wants to merge 1 commit intomasterfrom
Conversation
psmagin
left a comment
There was a problem hiding this comment.
Hey @mweaver-ebsco , How many more indexes do you plan to create? I understand that this improves fetch performance, but it also decreases insert/update performance.
adae30a to
ada3aac
Compare
| @@ -0,0 +1,6 @@ | |||
| CREATE INDEX IF NOT EXISTS instance_notes_staffonly_idx ON ${myuniversity}_${mymodule}.instance | |||
| USING gin ( | |||
| ${myuniversity}_${mymodule}.normalize_jsonb_array( | |||
There was a problem hiding this comment.
Technically, this doesn't need to be normalized, since this is actually stored as a true boolean in the JSONB, but it ends up being easier to work with as a normalized string, and there's basically no overhead in the index
|
@psmagin I'm not entirely sure. These are coming from our PO(s), targeting the most heavily used fields with poor read performance. Looking through our backlog, it looks like there are probably 5 more instance indexes to go (2 for electronic access fields, 2 for contributor fields, and one for series). Fortunately, these indexes are pretty targeted, so they shouldn't put a huge load on the DB (e.g., these notes indexes only affect instances with notes) during writes/updates. |
This commit adds new indexes for the sub-fields within instance notes and for instance administrative notes. These indexes will be used for querying by FQM (MODFQMMGR-1057).
ada3aac to
ada4867
Compare
|



Similar to #1309, this commit adds new indexes for the sub-fields within instance notes and for instance administrative notes. These indexes will be used for querying by FQM (MODFQMMGR-1057).
Purpose
This PR adds indexes for several instance fields. This will enable FQM to efficiently run queries based on these fields. They were identified as commonly used fields in FQM, but none of them have (useful) indexes available right now.
Approach
FQM works by accessing live data via DB views. This means that indexes in the source schema can be used directly by FQM to improve its query performance.
Changes Checklist
Related Issues
MODINVSTOR-1528
MODFQMMGR-1057