How can I change a secondary index? For example: I want to add a new column to the STORING
specification.
How to add new STORING column to index
86 views Asked by Mike Curtiss At
1
How can I change a secondary index? For example: I want to add a new column to the STORING
specification.
If you want to update an index to store a new column in its
STORING
clause, it takes a few steps. Cloud Spanner does not support updating index schemas directly, so you'll need to create a new index and drop your old index. For example, if you have an old index, "myindex", that you're trying to update:STORING
specification.Note that, if you want your new index to have the same name as the old index, you could repeat the same steps as above to re-create myindex. However, there will still be a temporary period where you won't have an index called "myindex" (this could last hours to days), so your application code would need to be resilient to this. It's typically easiest just to update your application code to point at the new index name.