Microsoft Access Questions

What techniques can be used to minimize the size of a Microsoft Access database? Here are some obvious possibilities. Which of them actually help?


The third law of optimization: Always use a profiler.


A real life example

An Access 97 database was migrated to Access 2003. The database has two huge tables, 1 small "Paste errors" table, 5 small "Import errors" tables, and other tables. Each measurement of file size was done by making the relevant change(s) in Access 2003, then compacting the database in Access 2003, then reading the file size in Windows Explorer.

One of the two huge tables has 600,000 rows, each with 106 bytes of data plus an empty 255 character string. The other huge table has 530,000 rows, each with 94 bytes of data plus an empty 255 character string. One of the "other tables" has 500,000 rows, each with 80 bytes of data. The remaining tables are much smaller.

If Access did not do any internal optimization, the compacted file size would be about 600,000 * 361 bytes + 530,000 * 349 bytes + 50 MB in other tables = 450 MB. The actual compacted file size is about 280 MB, so Access clearly does some internal optimization. As noted above, Access 2003 does not store "space characters for unused positions in" text and memo fields.

If Access did not do any internal optimization, then eliminating the empty 255 character string fields would reduce the compacted file size to about 600,000 * 106 bytes + 530,000 * 94 bytes + 50 MB in other tables = 165 MB. The actual compacted file size is about 520 MB, so Access clearly does some bloating.

What can be done to reduce the file size of this Access 2003 database?



Discussion


See also: MicrosoftAccess


EditText of this page (last edited March 12, 2010) or FindPage with title or text search