LQ scan / filtering simplification to speed up writes / Singer loads. #464
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.
When figuring out which objects to scan through, also add objects whose PKs overlap the PKs of the objects we are going to scan through and that come after them.
This is to simplify image creation so that, when making an object, we don't need to care about the old rows it overwrites (and hence don't need to calculate their hash or include it into the object or even find out what they are when we don't have access to the full current table). It will allow us to actually be able to treat objects independently, recalculate their hashes and the index, make it much easier to write to Splitgraph images without checkout etc. The main reason for this is to speed up data ingestion from Singer where we add up chunks of 100k rows and currently have to run a giant JOIN against the current table to figure out which rows we updated.
The tradeoff is that sometimes we'll scan through more objects (in the rare case where we're fetching some rows that aren't overwritten by a latter object but the object they come from partially overlaps with an older object).