cockroachdb / cockroachdb/cockroach

sql: distsql=always mode does not error if plan cannot distribute

Open
#128,627 2 comments 0 reactions 0 assignees View on GitHub
branch-master branch-release-24.1 branch-release-24.2 C-bug T-sql-queries
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.