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

Change the default sort order #938

Open
RFSH opened this issue Mar 28, 2022 · 0 comments
Open

Change the default sort order #938

RFSH opened this issue Mar 28, 2022 · 0 comments
Labels
annotation Anything related the annotations (adding new one or changing existing one) discussion required requires a discussion before moving forward tiny

Comments

@RFSH
Copy link
Member

RFSH commented Mar 28, 2022

Currently, the default sort order that we're using for reading a data set comes from the row_order defined under table-display annotation. If missing, we will use the shortest key columns as the default order.

For tables with system columns, this means using @sort(RID) (ascending order of RID). In most cases, we found that this is not a good default as we're usually setting the row_order to be the descending order of RMT (the newly modified data should come first). In this issue, we want to consider ways to facilitate this.

Based on a brief conversation that we had, we could,

  1. Use the descending RMT as our default if system columns are defined instead of just using the shortest key columns.

  2. Allow definition of default sort order on catalog or schema. Since the current row_order is part of table-display, I don't think allowing this annotation on schema/catalog would make sense. So we most probably should come up with either a new annotation or add it to the existing display annotation.

P.S. While discussing this, one suggestion was changing the default sort from ascending of the shortest key to descending. This was because we assumed sorting of RID works similarly to RMT. But RID order will not behave as expected when RIDs change in length. i.e., they are lexicographically sorted as strings, not as a monotonic numeric range. Also, RCT would be the proxy for RID as a serial creation order.

@RFSH RFSH added annotation Anything related the annotations (adding new one or changing existing one) enhancement discussion required requires a discussion before moving forward and removed enhancement labels Apr 5, 2022
@RFSH RFSH changed the title Default sort order Change the default sort order Jul 7, 2023
@RFSH RFSH added the tiny label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
annotation Anything related the annotations (adding new one or changing existing one) discussion required requires a discussion before moving forward tiny
Projects
None yet
Development

No branches or pull requests

1 participant