-
Notifications
You must be signed in to change notification settings - Fork 338
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
Some order by
SQL didn't use window sort
#5463
Comments
@evenyag It seems such a bug occurs when greptimedb/src/query/src/dist_plan/commutativity.rs Lines 46 to 52 in 5b6279f
For this query, because
Why |
As far as I know, we can add an alias for a subquery so pushing all alias expressions down isn't always correct. Maybe we can push the expr down if it is a column. Updated: Should we use the commutativity of alias.expr as the commutativity of alias? |
Modifying the commutativity works in standalone mode. However, the distributed mode still has some troubles. For example, the following SQL doesn't work in distributed mode. CREATE TABLE test(i INTEGER, t TIMESTAMP TIME INDEX) WITH('compaction.type'='twcs', 'compaction.twcs.max_inactive_window_files'='4');
INSERT INTO test VALUES (1, 1), (NULL, 2), (1, 3);
EXPLAIN ANALYZE SELECT t as ts FROM test ORDER BY t DESC LIMIT 5; substrait modified the plan and added a temp name
|
What type of bug is this?
Performance issue
What subsystems are affected?
Distributed Cluster, Standalone mode
Minimal reproduce step
Execute the following SQL:
What did you expect to see?
We expect that we should use window sort like this SQL
What did you see instead?
What operating system did you use?
Unrelated
What version of GreptimeDB did you use?
v0.11.2
Relevant log output and stack trace
The text was updated successfully, but these errors were encountered: