Skip to content

PPR API - Improve Account Registrations Table Drafts Database Query #21975

Closed

Description

@doug-lovett

This update is intended to generally improve PPR database performance of queries that populate the PPR account registrations table with drafts.

Background:
Some PPR API accounts have a large number of drafts. For example:
ESC: 243,696
Teranet: 1,004,413

The queries that populate the UI registrations table with drafts for an account filter, sort, and limit over the entire dataset. For these accounts with a large dataset the query execution takes seconds instead of milliseconds. As a baseline, an account with 10,000 registrations takes 0.1 seconds to execute.

Drafts that have have been used as a registration are no longer visible in the UI account registrations table.

To improve the account registrations table query performance, reduce the number of drafts that belong to an account.

  • When creating a registration that has a draft, append "_USED" to the draft record account id value, excluding it from future database queries.
  • Create a database update script to append "_USED" to the draft record account_id value for all existing drafts that have been used in creating a registration.

Activity

  1. self-assigned this
    on Jun 24, 2024
  2. doug-lovett commented on Jun 24, 2024

    @doug-lovett
    CollaboratorAuthor

    Unit Test Notes:
    Submit the API GET drafts on an account that has existing drafts.
    Run the database update script.
    Submit the API GET drafts on the same account and verify the results are identical.
    Create a draft security agreement
    Create a SA base registration from the draft.
    Verify the draft is excluded from the account drafts.
    Create a draft amendment.
    Create an amendment from the draft.
    Verify the draft is excluded from the account drafts.

  3. doug-lovett commented on Jun 26, 2024

    @doug-lovett
    CollaboratorAuthor

    Test Notes:
    Verify in the UI that creating a draft for a new PPR lien and a change to a base registration (amendment) is as expected in the UI registrations table.
    Verify in the UI that a draft no longer appears in the registrations table after it is used to create a registration.

  4. chdivyareddy commented on Jun 27, 2024

    @chdivyareddy
    Collaborator

    Verified in DEV!

    image.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions