Open RaduBerinde opened 2 years ago
We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!
One workaround is to add an unnecessary ORDER BY to the query, which will switch to shouldDistribute
: https://github.com/cockroachdb/cockroach/blob/1d74b00dd79850fa7c74db08793179260e965b5c/pkg/sql/distsql_physical_planner.go#L696
We currently don't recommend distributing constrained scans, even if they are very large: https://github.com/cockroachdb/cockroach/blob/d990758125a1e323ff28cb8ea661f8d1a97ea2e7/pkg/sql/distsql_physical_planner.go#L536
I think we should distribute anything that has to scan a large amount of data. A sample case is in https://github.com/cockroachdb/cockroach/issues/74736#issuecomment-1016073783 (although the large number of spans in the constraint is problematic there).
CC @yuzefovich
Jira issue: CRDB-12497