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.
Hi,
I'm sending some significant enhancements to optimize the script's performance. Here are the main changes implemented:
Streaming Query:
Instead of using the skip() function to query the database, we're now leveraging the power of streaming to retrieve data as it's being read. This eliminates query overhead and provides a continuous flow of data in a single query.
Batch Insertion:
To improve data insertion performance, we're now inserting data in batches.
Furthermore, we continue to apply the concepts of child processes. However, this time, I've implemented a dedicated child process solely for data querying. Once a list of items is accumulated, it's sent to other processes for parallel insertion, maximizing the benefits of parallelization already incorporated previously.