Database Space Management

A good friend of mine Anne Soilleux, is currently on extended training over in Redmond as well as probably buying more shoes than will fit in her suitcase, I received the following gem of information.

So to set the scene, OLD is the shorthand for OnLine Defragmentation - For further detail on what exactly occurs during OLM (OnLine Maintenance) and OLD then check out here

So we know that OLD needs to complete to do stuff with white space, but what does it actually do and what are the implications ?

Well here is the deal:

1) Every table in the database has a space tree associated with it.

 

2) There is also a global space tree, which is where each table grabs new pages from when it runs out of space.

 

3) If you free up space in a table, that space can only be used by the same table until OLD has run, at which point free pages are returned to the global space tree.

 

We have tables in the database for all the folders in the database, all the messages and all the attachments. Each of these also has an associated Long Value tree which stores large data that should be in that table.

 

So this basically means if someone deletes a load of messages without attachments and then you receive a load of messages with large attachments, we can’t reuse the space we freed up by deleting the messages to store the new attachments, so the database size will grow.