Skip to content

Support partial stats at extremes on hash-sharded indexes and REGIONAL BY ROW tables #128725

@Uzair5162

Description

@Uzair5162

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sql-table-statsTable statistics (and their automatic refresh).C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries Team

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions