Skip to content

Commit 78124db

Browse files
author
James Cor
committed
drop sorts in cross joins
1 parent 9929479 commit 78124db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/analyzer/replace_sort.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func replaceIdxSortHelper(ctx *sql.Context, scope *plan.Scope, node sql.Node, so
156156
case *plan.JoinNode:
157157
// TODO: is this applicable to other types of joins?
158158
// as long as left child is already sorted and SortFields are a prefix, then it's ok?
159-
if !c.JoinType().IsMerge() {
159+
if !c.JoinType().IsMerge() && !c.JoinType().IsCross() {
160160
continue
161161
}
162162
// It's (probably) not possible to have Sort as child of Join without Subquery/SubqueryAlias,

0 commit comments

Comments
 (0)