Skip to content
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

feat(storage): add is_sorted support for in-memory engine #121

Merged
merged 3 commits into from Nov 9, 2021

Conversation

skyzh
Copy link
Member

@skyzh skyzh commented Nov 8, 2021

Signed-off-by: Alex Chi iskyzh@gmail.com

This PR adds is_sorted to the planner. If order by is applied on pk, we do not need an extra order by executor, as the storage layer has already got it sorted.

ref #114

Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
@skyzh skyzh force-pushed the skyzh/in-memory-sort-iterator branch from dbfd19c to dc27c33 Compare November 8, 2021 06:27
@skyzh skyzh changed the base branch from skyzh/bump-toolchain to main November 8, 2021 06:27
@skyzh skyzh mentioned this pull request Nov 8, 2021
3 tasks
Copy link
Member

@wangrunji0408 wangrunji0408 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
btw, why not add an interface to storage layer to report whether itself supports the sort-primary-key feature. If the planner sees this feature is not supported, then just fallback to the order executor. This way, for non-sorted storage like in-memory engine, we don't need to implement sorting again.

@skyzh
Copy link
Member Author

skyzh commented Nov 9, 2021

LGTM
btw, why not add an interface to storage layer to report whether itself supports the sort-primary-key feature. If the planner sees this feature is not supported, then just fallback to the order executor. This way, for non-sorted storage like in-memory engine, we don't need to implement sorting again.

Indeed I have a plan to do so, but the planner must have access to the StorageImpl struct before doing this. We may take this into consideration when we implement the optimizer.

@skyzh skyzh merged commit 9f0b108 into main Nov 9, 2021
@skyzh skyzh deleted the skyzh/in-memory-sort-iterator branch November 9, 2021 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants