cockroachdb / cockroachdb/cockroach

sql/inspect: Support hash-sharded indexes in index consistency checks

Open
#154,762 0 comments 0 reactions 0 assignees View on GitHub
C-enhancement T-sql-foundations
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

INSPECT cannot check hash-sharded indexes for consistency. These indexes are currently filtered out during job creation.

Hash-sharded indexes have an implicit shard column (e.g., crdb_internal_x_shard_16) that must be included in LOOKUP JOIN conditions. The current INSPECT query generation (pkg/sql/inspect/index_consistency_check.go) builds join conditions only from user-visible columns, causing the query planner to fail with "could not produce a query plan conforming to the LOOKUP JOIN hint".

Note: this works in classic SCRUB because it uses FULL OUTER JOIN without hints, allowing the optimizer to choose hash/merge joins which don't require the shard column in join predicates.

Jira issue: CRDB-55106

Epic CRDB-55075

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.