-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Need to disable optimize_move_to_prewhere if query has FINAL. #8684
Copy link
Copy link
Closed
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official releaseeasy taskGood for first contributorsGood for first contributors
Description
On version 19.17.4, queries return different results, on version 19.15.2 everything works fine. The engines of both tables - ReplicatedReplacingMergeTree([updated_at])
SELECT g.item_id
FROM gmc_item_distributed AS g
FINAL
LEFT JOIN
(
SELECT
item_id AS i_item_id
FROM item_distributed AS is
FINAL
WHERE toDate(updated_at) >= toDate('2020-01-02')
) AS i ON g.item_id = i.i_item_id
WHERE (i.i_item_id = 0) AND (g.flag = 1)
GROUP BY g.item_id
SELECT g.item_id
FROM gmc_item_distributed AS g
FINAL
LEFT JOIN
(
SELECT
item_id AS i_item_id
FROM item_distributed AS is
FINAL
WHERE toDate(updated_at) < toDate('2020-01-02')
) AS i ON g.item_id = i.i_item_id
WHERE (i.i_item_id <> 0) AND (g.flag = 1)
GROUP BY g.item_id
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official releaseeasy taskGood for first contributorsGood for first contributors