-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
New featureFeature requestsFeature requestsSQLIssues or changes relating to SQL executionIssues or changes relating to SQL execution
Description
Is your feature request related to a problem?
Union used to push filters into the sub queries but it was abandoned in 6.4.2 because the tables can have different column names.
Describe the solution you'd like.
When query
SELECT * FROM
bus INNER JOIN (
(SELECT datetime,"from" as busId FROM branch2 WHERE logical)
UNION
(SELECT datetime,"to" as busId FROM branch2 WHERE logical)
)
u ON bus.busId = u.busId AND bus.datetime = u.datetime
WHERE bus.datetime = '2026-10-05T09:55'it should push datetime = '2026-10-05T09:55' filter into UNION parts like this
SELECT * FROM
bus INNER JOIN (
(SELECT datetime,"from" as busId FROM branch2 WHERE logical AND datetime = '2026-10-05T09:55')
UNION
(SELECT datetime,"to" as busId FROM branch2 WHERE logical AND datetime = '2026-10-05T09:55')
)
u ON bus.busId = u.busId AND bus.datetime = u.datetime
WHERE bus.datetime = '2026-10-05T09:55'Describe alternatives you've considered.
No response
Additional context.
Reported in #2182
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
New featureFeature requestsFeature requestsSQLIssues or changes relating to SQL executionIssues or changes relating to SQL execution