Multi fk fixes and better batch inserts - #55
Merged
Conversation
Prior to this change, the change log copy function would take a list of integers (pks) to process. However, Postgres has a limitation that a function may only be called with up to 100 arguments. That means that only 100 pks could be batch processed at a time, which isn't a large sum. This approach changes this by allowing the function itself to query a batch of any arbitrary length (defined at the beginning of the process), and use that batch for processing. This allows us to batch process large quantities and thus finish the process much faster.
Prior to this change, a part of the clean_up function that changes the name of foreign keys back to their original wasn't handling referring tables that had more than one FK to the original table. This commit changes that, so that no matter how many FKs a referring table has to the original table there won't be any problems.
Coverage Report Results
1 empty file skipped. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
Change strategy for change log copy function
Prior to this change, the change log copy function would take a list of
integers (pks) to process.
However, Postgres has a limitation that a function may only be called
with up to 100 arguments. That means that only 100 pks could be batch
processed at a time, which isn't a large sum.
This approach changes this by allowing the function itself to query a
batch of any arbitrary length (defined at the beginning of the process),
and use that batch for processing.
This allows us to batch process large quantities and thus finish the
process much faster.
Fix when referring table has multiple FKs
Prior to this change, a part of the clean_up function that changes the
name of foreign keys back to their original wasn't handling referring
tables that had more than one FK to the original table.
This commit changes that, so that no matter how many FKs a referring
table has to the original table there won't be any problems.