Added querycount to getWithExtraInfo #367
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixed the
getWithExtraInfo
which was not using pagination, which was creating queries with 5000 Union statements. Also set the default value of queryCount as 50, and set the limitation on the setter method to not set above 50.In conversation with MySQL team to know the ideal pagination count, they suggested 12. 12 seems too low looking at the 5000 union ran today. Working with them to test it on test server or prod read-replica
Update:
MySQL team suggested to have any number between 12-100, it's all guesses and it's difficult to get the exact one without proper metrics. Yang suggested to go with 50 for now, but we can change it one way or the other.
Testing
./gradlew build
Tested locally on metadata-store
Made few changes to TMS:
dao.setQueryKeysCount(2);
to BaseLocalDaoFactorydao.setQueryKeysCount(cfg.queryKeysCount);
in DatasetLocalDaoFactoryIngested some dummy records
Run batchGet to get Status aspect for the dummy records
Checked the log on metagalaxy_local mysql.general_log table
Ran these two commands to enable general_log before running batch get
Now, checked the general_log to see UNION of size 2, please scroll right to argument column
Checklist