You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
execbuilder: use lookup join lookup table distribution in home region checking
This commit updates enforce_home_region checking to build the lookup
join lookup table's distribution the same as is done in the coster.
This can prevent some lookup joins with a home region from being
errored out as not having a home region.
Informs: cockroachdb#105942
Release note: None
# This query should error out dynamically during execution, but
667
+
# `GetLookupJoinLookupTableDistribution` doesn't currently work in
668
+
# the execbuilder phase because `Optimizer.stateMap` is empty.
669
+
# TODO(msirek): Fix this test case to not error out statically.
642
670
statement error pq: Query has no home region\. Try adding a filter on o\.crdb_region and/or on key column \(o\.cust_id\)\. For more information, see https://www.cockroachlabs.com/docs/stable/cost-based-optimizer.html#control-whether-queries-are-limited-to-a-single-region
643
-
SELECT * FROM customers c JOIN orders o ON c.id = o.cust_id AND
671
+
SELECT 'a' FROM customers c JOIN orders o ON c.id = o.cust_id AND
644
672
(c.crdb_region = o.crdb_region) WHERE c.id = '69a1c2c2-5b18-459e-94d2-079dc53a4dd0'
0 commit comments