Skip to content
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

Script to merge positions #204

Closed
jsangmeister opened this issue Jul 14, 2022 · 1 comment
Closed

Script to merge positions #204

jsangmeister opened this issue Jul 14, 2022 · 1 comment
Labels
Milestone

Comments

@jsangmeister
Copy link
Contributor

A script to merge positions by some filter (e.g. age) into one has multiple uses:

  • After a large initial import, a lot of positions are created because the client sends everything as seperate requests. Merging them into one initial position could prove valuable for future performance.
  • After a lot of work has been done on an instance, very old data may no longer be needed in the history (e.g. older than one month/one year/...). For such an instance, we can merge all positions which are older into one to save space and potentially increase the performance.

This should be able to be done relatively easily by building all models up to the last position to be merged and then creating one CREATE event per model which is used in the single position (and additionally one DELETE event for deleted models). All positions to be merged except one are then deleted and the one which is kept is filled with the new events. This should keep the datastore and the history consistent and also not change any current data.

@jsangmeister jsangmeister added this to the 4.0 Release milestone Jul 14, 2022
@rrenkert rrenkert modified the milestones: 4.0 Release, 4.1 Release Nov 3, 2022
@jsangmeister jsangmeister modified the milestones: 4.1, 4.x Dec 12, 2023
@jsangmeister
Copy link
Contributor Author

The performance gain was only relevant for the old, position-based migrations. The new model-based migrations do not care about the amount of positions, so I'm closing this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants