-
Notifications
You must be signed in to change notification settings - Fork 4.1k
opt: infinite recursion between EliminateGroupByProject and PruneGroupByCols #100478
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-sql-optimizerSQL logical planning and optimizations.SQL logical planning and optimizations.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.GA-blockerT-sql-queriesSQL Queries TeamSQL Queries Teambranch-release-23.1Used to mark GA and release blockers, technical advisories, and bugs for 23.1Used to mark GA and release blockers, technical advisories, and bugs for 23.1v23.1.2
Description
Some queries can cause the optimizer to recurse indefinitley between two normalization rules, EliminateGroupByProject and PruneGroupByCols. Below is an optimizer test that reproduces the infinite recursion:
exec-ddl
CREATE TABLE p (
region STRING NOT NULL,
id INT,
PRIMARY KEY (region, id),
UNIQUE INDEX p_id_idx (id)
)
----
exec-ddl
CREATE TABLE c (
region STRING NOT NULL,
id INT PRIMARY KEY,
p_id INT NOT NULL,
FOREIGN KEY (region, p_id) REFERENCES p (region, id)
)
----
norm
SELECT p.id FROM p JOIN c ON p_id = p.id GROUP BY p.id
----
Jira issue: CRDB-26457
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-sql-optimizerSQL logical planning and optimizations.SQL logical planning and optimizations.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.GA-blockerT-sql-queriesSQL Queries TeamSQL Queries Teambranch-release-23.1Used to mark GA and release blockers, technical advisories, and bugs for 23.1Used to mark GA and release blockers, technical advisories, and bugs for 23.1v23.1.2
Type
Projects
Status
Done