Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Spanner mutation limit for delete by KeySet

Cloud spanner’s mutation limit per commit 20,000. For a mutation delete using KeySet, does this count as one mutation, or does the size of the KeySet determine the number of mutations? For example:

  List<Mutation> mutations = new ArrayList<>();
  mutations.add(
      Mutation.delete(
          "Albums", KeySet.newBuilder().addKey(Key.of(2, 1)).addKey(Key.of(2, 3)).build()));


  dbClient.write(mutations);

Does this count as one mutation, or two? If I’m doing a batch delete with KeySet, then do I need to page the keys into sets of 20K?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The size of the KeySet determines the number of mutations, with each key counting as a mutation.

Note that any indexes on the table will also multiply the mutation count for each key: https://cloud.google.com/spanner/quotas#note2.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading