-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance improvements : Index on ClaimMutationID #362
base: develop
Are you sure you want to change the base?
Conversation
MutationLog request per ClientMutationID is one of the most common request in the database. On a fresh install this kind of request is not really challenging, but for hundreds of uses and millions of mutation in the table without index, the database is really struggling.
Quality Gate passedIssues Measures |
What would you think about this kind of approach |
@mngoe I am surprised to see no migration did you run makemigrations ? |
the difference is largely significant in large volume of data. We got this issue with Social Security Fund Nepal with almost 1 TB of database size, consisting of around ~300GB of textual data , ~600GB attachment (the attachment was configured to be stored in db which was bad choice previously ). Contributing around ~40GB of Mutation log table Major problem faced: Diagnosis of the performance issue
Analysis Deep analysis Why Integer Primary Key is Faster? Since, we are not using any distributed kind of things so, using pk as auto-increment field is better choice. Mitigation strategy:
|
thanks i will check on this one , also whatever we need to do, the data type should support indexing |
@sunilparajuli thaks a lot for that feedback, we already reached the conclusion that MSSQL was not ideal but it adds up; why cannot we clear/archive mutation log with a running windows of 7 days ? |
I just mean it was taking lot of time (as a metaphor or smthing), it could take lots of hours for clearing the data but the risk was maintaining uptime. (deleting process of mutation log with parallel insertion of mutation log from active claim insertion) When we perform a DELETE operation in a database like MSSQL, the system needs to lock the rows, pages, or even the entire table to ensure that no other operations interfere with the deletion process. Even if you try to limit the locks to individual rows (using something like ROWLOCK), deleting a large amount of data can cause the locks to escalate to a table-level lock. This means the entire table gets locked, which can block other operations like reads or writes. If the table is being used actively—for example, in a 24/7 service where data is constantly being added or queried—this locking can create contention, when multiple operations are trying to access the same resource (in this case, the table) at the same time. Because of this probably , the deletion process becomes much slower because it has to compete with other operations for access to the table. So deleting a large amount of data from an actively used table can take a very long time. There could be other factors affecting the operation's efficiency like how much resources maxime has allocated in the infrastructure. |
MutationLog request per ClientMutationID is one of the most common request in the database.
On a fresh install this kind of request is not really challenging, but for hundreds of uses and millions of mutation in the table without index, the database is really struggling.