Skip to content

[YSQL] Use geo-location (tablespace) as a cost component in query planner #7535

@m-iancu

Description

@m-iancu

Jira Link: DB-1318
Specifically, if multiple indexes exist in different tablespaces but are otherwise identical (i.e. w.r.t to included and indexed columns) we should pick the one that (best) matches the placement info of the current node (if any).
We'd need to:

  1. get the tablespace info from the metadata (and their respective placements) -- pg_tablespace table (should be in cache, if not we might need to add it).
  2. Get the placement info of the current node (we should have this in the tserver FLAGS_placement_cloud/region/zone flags) -- see YBUnsupportedFeatureSignalLevel in pg_yb_common.c for how to use them in YSQL layer.
  3. In the cost calculation from ybcam.c we should use this data appropriately.

cc @deeps1991 @ramsrivatsa

Metadata

Metadata

Assignees

Labels

area/ysqlYugabyte SQL (YSQL)kind/enhancementThis is an enhancement of an existing featurepriority/mediumMedium priority issue

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions