Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 DB

    • create 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
367919119diagramDisplayName
mVer2
simple0
zoom1
simpleinComment0
inCommentpageId0367919119
custContentId367460397pageId
diagramDisplayNameSpitfire-CallNumber-Refactoring-indexing.drawio
lbox1
contentVer3
revision3
baseUrlhttps://folio-org.atlassian.net/wiki
diagramNameSpitfire-CallNumber-Refactoring-indexing.drawio
pCenter0
width1229
links
tbstyle
height1611

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
mVer2
simple0
zoom1
inComment0
pageId367919119
custContentId519733283
diagramDisplayNameSpitfire-Callnumber-Refactoring-Activity.drawio
lbox1
contentVer1
revision1
baseUrlhttps://folio-org.atlassian.net/wiki
diagramNameSpitfire-CallNumberCallnumber-Refactoring-indexingActivity.drawio
pCenter0
width1094443
links
tbstyle
height729717

Browsing Sequence Diagram

The browsing call numbers follow the approach used for the classification browse feature (Browse Instance classification numbers - Phase 1 POC).

Drawio
mVer2
zoom1
simple0
inComment0
custContentId367951901
pageId367919119
lbox1
diagramDisplayNameSpitfire-CallNumber-Refactoring-browse.drawio
contentVer1
revision1
baseUrlhttps://folio-org.atlassian.net/wiki
diagramNameSpitfire-CallNumber-Refactoring-browse.drawio
pCenter0
width750
links
tbstyle
height494

...