...
Target Architecture
Summary
The solution is based on a new reindexing approach proposed in Reindex Improvements. The aspects of the proposed solution points
In
mod-search
PostgreSQL DBcreate a table for call numbers
on create/update/delete events for items create a new trigger procedure that would extract call numbers and related from items/instance
Adjust the Reindexing procedure and Ongoing domain events consuming for items
Create a separate index for call numbers
Refactor browse queries to use
search_after
search_before
queries
Indexing Sequence Diagram
As per the current approach for reindexing the indexing of call numbers is split into two main phases: merge and upload. The merge phase is already present in the reindexing procedure.
Drawio | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
For performance purposes, the extraction of call numbers (step 16) should happen on the database side. The current approach uses batch inserts to insert items into the table. It is proposed to create a new PL/pgSQL procedure to extract call numbers. The next section describes the details of the mentioned procedure.
Extract Call Numbers Activity Diagram
The diagram below describes the procedure that should be created for inserting items and extracting call numbers in the PostgreSQL database. The procedure should be used instead of bulk inserts. Key aspects:
The flag whether to extract and store call numbers should be stored in the database
The temporary table should be created inside of the procedure based on the main table
create temp table tmp_callnumber (like callnumber including indexes);
Insert from the temporary table into the main table should be ordered to avoid deadlocks on main table indices
Drawio | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Browsing Sequence Diagram
The browsing call numbers follow the approach used for the classification browse feature (Browse Instance classification numbers - Phase 1 POC).
Drawio | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...