0

How does Cloud Spanner decide which of the available secondary indices to use, or whether to use one at all? Is there documentation on how your query planner works?

Maxim
  • 4,075
  • 1
  • 14
  • 23
willwilson
  • 422
  • 3
  • 8

1 Answers1

1

Cloud Spanner uses a number of different heuristics to guide index selection, and they may change without warning. If you’re curious which indices a query is using, you should try EXPLAINing the query to see the plan that gets run. If you want to guarantee selection of a particular index, consider using an Index Directive.

willwilson
  • 422
  • 3
  • 8