Why compact an Access Database?

C

Charles A. Lackman

Why should a person compact their access database? I have noticed that
doing so creates a new database that is compacted instead of compacting the
current database, why can't you just compact the database you are using. I
am referring to the ADO. Replication Object libruary and the jro.jetengine
within Visual Studio.net.

Thanks

Chuck
 
W

William \(Bill\) Vaughn

Demes da breaks. This is because the technology was not built to do so. It's
a tough job to defrag a file. It's far easier (and faster/safer) to simply
copy out the "good" data to a new file. It leaves you with a viable backup
as well.

--
____________________________________
Bill Vaughn
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
M

Merlin

All data in a database is referenced by an internal index, when you delete a
record the internal index reference is marked as deleted - the actual data
is not really deleted; compacting simply recreates the database record for
record skipping the deleted indexed items. At the same time error checking
and other optimisations are being performed.
Reasons to compact the database are to shrink the data file by removing
deleted records and at the same time this speeds data access as the system
does not have to move through deleted records when performing data
retrieval.

As you can see you can't possibly still work on a database while all this is
going on, especially as records are being internally reorganised.

Merlin
 
J

Joe Fallon

There are other reasons too.
One is that the data pages are re-arranged to be contiguous.
(Faster data access due to fewer page reads.)
Indexes may get re-built too.

etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top