- 
    Task 
- 
    Resolution: Done
- 
    Major 
- 
    None
- 
    None
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.
- is related to
- 
                    SWATCH-3786 Configure a job that will flush the outbox on a schedule -         
- In Progress
 
-