-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added greater and less than query optimization to snapshot table queries #3396
added greater and less than query optimization to snapshot table queries #3396
Conversation
if (snapshotPred != null && snapshotPred.function() instanceof Equal) { | ||
specificSnapshot = (Long) snapshotPred.literals().get(0); | ||
if (snapshotPred != null) { | ||
if (snapshotPred.function() instanceof Equal) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause performance degradation of equal, because this requires list files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally I had preserved the efficiency in snapshotsWithinRange
, with the new code removing the list call it should still be efficient with the iterating on a single snapshopId
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ctrlaltdilj for the contribution!
Left one comment.
return Collections.singletonList(snapshot(maxSnapshotId)).iterator(); | ||
} | ||
|
||
return listVersionedFiles(fileIO, snapshotDirectory(), SNAPSHOT_PREFIX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to list directory.
Can we directly read one by one?
We can combine maxSnapshotId, minSnapshotId, earliest and latest. Calculate a queryable interval and directly call the snapshot
method one by one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed list call, lmk what you think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
optimizing queries on snapshot table