cockroachdb / cockroachdb/cockroach

Support EXPLAIN ANALYZE with creating unspecified partial stats

Open
#128,904 0 comments 0 reactions 0 assignees View on GitHub
A-sql-table-stats C-enhancement T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

We require `reqStats` to have only 1 element in `createPartialStatsPlan()`
https://github.com/cockroachdb/cockroach/blob/c9f233b4778cfaee864e8e44518fd33a7f5476b0/pkg/sql/distsql_plan_stats.go#L281

This works for `CREATE STATISTICS FROM USING EXTREMES` where we don't specify a column since we plan and run create stats separately for each column in the default set. However, this doesn't support `EXPLAIN ANALYZE CREATE STATISTICS FROM USING EXTREMES` and certain other EXPLAINS (such as `EXPLAIN (VEC)`) since we pass job details with all of the columns in the default column set together and expect a single plan: https://github.com/cockroachdb/cockroach/blob/34057369826b8b9384b4f20a38cbce55bded5d81/pkg/sql/distsql_physical_planner.go#L3802

Jira issue: CRDB-41268

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.