-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
sql: ordering of SRFs is not taken into account during planning #26704
Comments
We have marked this issue as stale because it has been inactive for |
This issue does not seem urgent, so I'm moving it out of the High Likelihood bucket for this release. Feel free to comment if you disagree. |
Addresses: cockroachdb#26704 ProjectSet, like Project, should always preserve input orderings (for columns that are included in the output). Previously we were not tracking this in the optimizer. This patch adds ordering code for ProjectSet (which mostly matches the ordering code for Project). This patch does not add orderings that come from the zipped functions, such as set-returning functions like `generate_series`, so this does not yet fix Release note: None
We have marked this issue as stale because it has been inactive for |
If a result order is required on the output of a SRF, a sort stage will always be added, even though most SRFs have a natural order (
generate_series
in the direction of the increment,generate_subscripts
is always ascending,_pg_expandarray
is always ascending in the subscript column, etc).This would benefit from a simplification based on some properties annotated on the SRFs themselves.
Found while investigating #26701.
cc @RaduBerinde @solongordon
Jira issue: CRDB-4990
The text was updated successfully, but these errors were encountered: