Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-4141

Create index on hbi_event_outbox table's created_on column.

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • Next - API
    • None
    • swatch-metrics-hbi
    • None
    • 5
    • False
    • Hide

      None

      Show
      None
    • False
    • subs-swatch-thunder
    • Swatch Thunder Sprint 3

      The batching query used to flush the outbox is doing a sort on `created_on` column to process the records in the order they were created. Without the index the query will take too long even with a small batch size.

      Idea for how to do this:

      • Create a sql script that will put 3.5m placeholder records in the database table
      • Run SQL query to fetch, note the time
      SELECT * FROM hbi_event_outbox ORDER BY created_on ASC LIMIT 1000
      

      Note: we can play with adjusting the limit 1000 to get better performance

      • Add index to the table and repeat the process, note the time.

      Acceptance Criteria

      • Changeset created to add the index to the table.
      • Performance check to ensure that the index improves the query time.
      • Performance check on the liquibase update, given that there are 3.5 million records currently in stage.

              rhn-engineering-wpoteat William Poteat
              mstead@redhat.com Michael Stead
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: