Uploaded image for project: 'RAML Module Builder'
  1. RAML Module Builder
  2. RMB-552

smart index recreation on module upgrade

    XMLWordPrintable

    Details

    • Template:
    • Sprint:
      CP: sprint 83, CP: sprint 84
    • Story Points:
      8
    • Development Team:
      Core: Platform

      Description

      "CREATE INDEX IF NOT EXISTS name (expression)" only checks whether an index of that name already exists. It does NOT compare whether the existing index has the same expression. This works as documented: https://www.postgresql.org/docs/current/sql-createindex.html#id-1.9.3.69.6

      Module upgrading requires to drop indexes where the expression has changed.
      RMB-550 simply drops all indexes on upgrades. Recreating all indexes takes a lot of time.

      Be more smart: On each (non-SNAPSHOT) release save all CREATE INDEX statements in the database. We already have the rmb_internal table that currently stores rmb and module version: https://github.com/folio-org/raml-module-builder/blob/v29.2.2/domain-models-runtime/src/main/resources/templates/db_scripts/main.ftl#L15

      During upgrade drop the existing index and create the index if no or a different index expression was saved.

      Usecase 1: RMB changes how an entry in schema.json is converted into an SQL expression, for example by wrapping the expression into left(..., 600).
      Usecase 2: The module changes an entry in schema.json, for example from

      "fieldName": "keyword",
      "multiFieldNames": "title,contributors[*].name"
      

      to

      "fieldName": "keyword",
      "multiFieldNames": "title,contributors[*].name,identifiers[*].value"
      

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                julianladisch Julian Ladisch
                Reporter:
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases