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

Option to not specify ORDER BY #115

Open
dvilker opened this issue Jan 10, 2025 · 2 comments
Open

Option to not specify ORDER BY #115

dvilker opened this issue Jan 10, 2025 · 2 comments
Labels
feature New feature or request proposal

Comments

@dvilker
Copy link

dvilker commented Jan 10, 2025

Now, if you do not specify any YqlOrderBy, then ORM itself will add sorting by the primary key. But this is not always necessary.

@nvamelichev nvamelichev added feature New feature or request proposal labels Jan 10, 2025
@nvamelichev
Copy link
Collaborator

nvamelichev commented Jan 10, 2025

Having an ORDER BY primary key if no explicit sort order is specified is a good default.

We can potentially add opt-ins for "I don't care about query order", like OrderExpression.unordered(schema>)/EntityExpressions.unordered(<entity type>)/OrderBuilder.unordered() and YqlOrderBy.unordered(). Implementation for InMemory might be a no-op (and continue sorting) or (IMHO a better option) it might apply a Collections.shuffle() on the results, to uncover ordering assumptions early in the testing phase.

@nvamelichev
Copy link
Collaborator

@dvilker Hi Dmitry, is the opt-in variant of "don't sort the query results" suitable for your needs? If yes, it seems reasonably easy to add to YOJ, and we'll do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request proposal
Projects
None yet
Development

No branches or pull requests

2 participants