Skip to content

config, opt: teach localityMatchScore about voter_constraints  #59482

@aayushshah15

Description

@aayushshah15

localityMatchScore() aids in computing the scan cost of a single row, from a given index idx, based on how well the locality tiers of the gateway match the zone config constraints on idx. This allows the cost model to prioritize choosing indexes that are geographically closer over the ones that are further away from the gateway node.

With the introduction of the new voter_constraints attribute, voting replicas are constrained by the existing constraints (which apply to all replicas - voting and non-voting) as well as voter_constraints (which apply only to voting replicas). Thus, localityMatchScore() needs to be updated to include this new attribute when computing its result.

Jira issue: CRDB-3285

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries Teamdocs-donedocs-known-limitation

    Type

    No type

    Projects

    Status

    Cold Storage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions