When collecting partial stats on specified columns, we search for an index prefixed by that column in:
|
func (n *scanNode) initDescSpecificCol(colCfg scanColumnsConfig, prefixCol catalog.Column) error { |
This doesn't work for hash-sharded indexes and REGIONAL BY ROW tables since partition keys prefix the indexes. We would also need to update bounds.ConstructUsingExtremesSpans() to build the correct spans to be scanned:
|
func ConstructUsingExtremesSpans( |
We would also need to update how we select columns to collect partial stats on when unspecified by selecting the first column after the partition key.
Jira issue: CRDB-41160
When collecting partial stats on specified columns, we search for an index prefixed by that column in:
cockroach/pkg/sql/scan.go
Line 227 in c64fb80
This doesn't work for hash-sharded indexes and REGIONAL BY ROW tables since partition keys prefix the indexes. We would also need to update
bounds.ConstructUsingExtremesSpans()to build the correct spans to be scanned:cockroach/pkg/sql/stats/bounds/extremes.go
Line 59 in c64fb80
We would also need to update how we select columns to collect partial stats on when unspecified by selecting the first column after the partition key.
Jira issue: CRDB-41160