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: support limit and offset clause #75

Merged
merged 2 commits into from Oct 31, 2021
Merged

feat: support limit and offset clause #75

merged 2 commits into from Oct 31, 2021

Conversation

wangrunji0408
Copy link
Member

In this PR, we introduce slice operation for array and data chunk. Current implementation is simply copying the data, which is very inefficient. I plan to turn the DataChunk into a reference to array slice (like Bytes) in future PR. Any better ideas for this problem?

@wangrunji0408 wangrunji0408 added the enhancement New feature or request label Oct 31, 2021
@skyzh
Copy link
Member

skyzh commented Oct 31, 2021

We may use logical_rows or visibility bitmap :)

@wangrunji0408
Copy link
Member Author

What is logical_rows? A reference to array + index array?

@skyzh
Copy link
Member

skyzh commented Oct 31, 2021

Yes. logical_rows: &[usize] is an index into array. e.g. logical_rows = [2, 1, 0] yields a reverse order of array. From my experience, it's better to define it as a enum, LogicalRows::Sequential and LogicalRows::Indexed(&[usize]), or Option<&[usize]>.

Another approach is to use visibility. Then we might go back to RisingWave and our previous versions.

Copy link
Member

@skyzh skyzh left a comment

Choose a reason for hiding this comment

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

Good work!

@TennyZhuang
Copy link
Collaborator

Yes. logical_rows: &[usize] is an index into array. e.g. logical_rows = [2, 1, 0] yields a reverse order of array. From my experience, it's better to define it as a enum, LogicalRows::Sequential and LogicalRows::Indexed(&[usize]), or Option<&[usize]>.

Another approach is to use visibility. Then we might go back to RisingWave and our previous versions.

We can do this later, with full benchmark.

@wangrunji0408 wangrunji0408 merged commit a0f4cdc into main Oct 31, 2021
@wangrunji0408 wangrunji0408 deleted the wrj/limit branch October 31, 2021 13:13
@wangrunji0408 wangrunji0408 mentioned this pull request Nov 3, 2021
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants