cockroachdb / cockroachdb/cockroach
sql: distsql=always mode does not error if plan cannot distribute
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
It can be difficult to understand why a plan cannot distribute. One tool we could use to investigate this is `SET distsql = always`, if it caused statements that cannot distribute to fail with an error explaining why. However, it seems that this mode has never returned an error, and is functionally equivalent to distsql=on.
Here's a demonstration on v24.2.0-rc.1:
```sql
CREATE SEQUENCE seq;
SET distsql = always;
-- this does not fail, even though it must use local distribution
SELECT nextval('seq');
EXPLAIN ANALYZE SELECT nextval('seq');
```
It would be nice to have a distsql mode (or a variant of EXPLAIN) that helps us understand why a plan cannot distribute.
Jira issue: CRDB-41114
Contributor guide
Assessment
This issue has not been assessed yet.