Mathias Rönnlund
Mathias Rönnlund

Reputation: 4855

Freeing up space in Cosmos db

I have a cosmos db collection over 41GB in size. In it one partition key was overrepresented with about 17GB of data. I am now running a a program that is going through all the documents with that partition key and removing some unnecessary fields from each document, which should reduce every affected document with about 70%. I'm doing this because data size per partition key cannot exceed 20GB.

When the run is now half way through I can see that index size is decreasing but the data size seems unaffected. Is this the same as the .mdf file in Sql server reserving empty space or is there just some delay in the statistics?

enter image description here

Upvotes: 0

Views: 450

Answers (1)

NotFound
NotFound

Reputation: 6272

To give you an idea what to expect. I've done roughly the same while also changing some property names in the process and here's what my graph looks like after more than a month with no significant changes to the data afterwards. You can disregard the single point spikes. I think it sometimes misses a physical partition or counts one twice.

In my situation I see no change at all in index size while the data size seems to move all over the place. I'm running with minimal RU so every time the size suddenly increases the RU is automatically scaled up without notification.

enter image description here

Upvotes: 2

Related Questions