Friday, June 08, 2012

Efficiently compacting an Outlook PST file

If you use Outlook and do the right thing by backing up the file store it creates every so often in addition to a main backup you may have noticed just how large it can get.

Some reading this will already know why, but a brief analogy for those who don't.

Imagine a magic warehouse designed to store boxes. A box arrives and is placed in the warehouse and fills it completely. Another box arrives, but the warehouse is full! Not so, the magic warehouse expands to accommodate the new box. Every time a box arrives the warehouse gets larger. This is how the Outlook PST (Personal STore) file works with emails.


But you don't want to keep every email, so you mark up a few for deletion and every so often clean them all out. With our Magic Warehouse this means creating a few spaces. By itself not really a problem, but what happens when a new message/box arrives?

One would expect it to be placed into one of the existing gaps; but it's not - a whole new space is created for it and the warehouse/store gets larger.


Now Outlook can be set to remove all this space every so often, but to do so Outlook needs to be both running and idle - if you're the type of person who boots it up just to check their emails and closes it afterwards it's not going to get a chance to do that.


Fortunately there's a way of doing it manually. Tools|Account Settings and the Data Files tab will display all the stores Outlook is using. Settings will offer a Compact Now button.

So do that every so often and everything will be fine; except perhaps not. Turns out Outlook won't remove all the gaps it'll leave either 16kb or 4% of the pre-compacted capacity depending on which is the larger. Again so what? Well that 16Kb is pitiful it's the 4% that'll catch ya.

Returning to our warehouse imagine it has grown to accommodate 2,000 boxes, but is storing only 1,000. If we'd removed all 1,000 and then compacted we'd be left with a capacity of 1080. That is removing 1,000 spaces down to a minimum of 4% of 2,000 or 80. That's much better, but what would have happened if we'd removed those 1,000 boxes in increments of 100 and compacted each time?

At the end of the process we'd still have 1,000 boxes but our warehouse capacity would be down to 1,047. This is because the 4% keeps dropping between compacts so it can remove more space.

What this means is that those companies who deal with a large number of Outlook stores and who periodically delete large amounts of 'rubbish' and then compact are using up more space than those who delete small amounts and then compact on a more regular basis.

The short story is - delete and compact often and not in massive lumps.

2 comments:

Marshal said...

Hi,

This article is very informative and thanks for sharing it. I have noticed that most of the time Outlook corruption take place due to large size of PST file. It is advisable to compact PST file to avoid any corruption in Outlook. Now you must be thinking how to do it. It’s very easy and you can do it yourself you just need to download Stellar Phoenix compact PST software to compress PST file data from Outlook. This way you can prevent Outlook from any corruption which may occur due to large size of PST file.

FlipC said...

Or, given that you're manually compacting the PST file anyway, just create a new one and archive off old emails into it and then compact that.