Index partition-what happens if the partition key changes

Lets say, i have created a partitioned index with COL A and COL B as the partition keys. After creation of the index, i have ingested many documents in the bucket. later if I update the partition keys, will Couchbase move the indexes around according the updates made to the partition keys

PARTITION keys must be immutable. Index Partitioning | Couchbase Docs

The partition keys should be immutable, that is, its values shouldn’t change once the document is created. For example, in the landmark keyspace, the field named activity almost never changes, and is therefore a good candidate for partition key. If the partition keys have changed, then the corresponding document should be deleted and recreated with the new partition keys.

If immutability constraint is violated (CREATE index will not enforce immutability), index partitions can be inconsistent and it may affect query result.
If already violated not able identify document to delete and insert, drop the index and create again.

FYI: document key (META().id ) is immutable.

1 Like