-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57247 from ClickHouse/backport/23.8/57196
Backport #57196 to 23.8: Fix incorrect JOIN plan optimization with partially materialized normal projection
- Loading branch information
Showing
3 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
13 changes: 13 additions & 0 deletions
13
tests/queries/0_stateless/01710_normal_projection_join_plan_fix.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
DROP TABLE IF EXISTS t1; | ||
DROP TABLE IF EXISTS t2; | ||
|
||
CREATE TABLE t1 (id UInt32, s String) Engine = MergeTree ORDER BY id; | ||
CREATE TABLE t2 (id1 UInt32, id2 UInt32) Engine = MergeTree ORDER BY id1 SETTINGS index_granularity = 1; | ||
INSERT INTO t2 SELECT number, number from numbers(100); | ||
ALTER TABLE t2 ADD PROJECTION proj (SELECT id2 ORDER BY id2); | ||
INSERT INTO t2 SELECT number, number from numbers(100); | ||
|
||
SELECT s FROM t1 as lhs LEFT JOIN (SELECT * FROM t2 WHERE id2 = 2) as rhs ON lhs.id = rhs.id2; | ||
|
||
DROP TABLE t1; | ||
DROP TABLE t2; |