Use inner joins instead of left joins on transactions #1465
+23
−19
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.
This fixes a bug that I introduced with the performance fixes.
On incremental runs we still select all of the decoded data in some cases. When we then
left join
instead ofinner join
the data that is more than 1 week old will have empty transaction data. To fix this we should useinner join
. This should not be a problem because all decoded data has a transaction.In the cases where we already filter decoded data on
where evt_block_time >= (select max(block_time) from {{ this }})
for incremental runs, this should not have caused any issue. But for opensea which doesn't have that for example it did.If we still have to do a
left join
like we seemingly do on opensea fees, we can add the filter in the where statement as well to make sure we don't get any extra data.Looksrare doesn't have this problem because it already uses an
inner join
.I've verified the following:
where
statement as wellblock_time
block_time
like before