473,387 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Compact On Close Question

Does "Compact On Close" do a "Compact and Repair" or just a compact.
Is a compact necessary (or at least a good idea) on a regular basis,
say weekly, for a database that has several hundred records per week
added to it?

TIA.

Nov 13 '05 #1
4 2055
Wayne wrote:
Does "Compact On Close" do a "Compact and Repair" or just a compact.
Is a compact necessary (or at least a good idea) on a regular basis,
say weekly, for a database that has several hundred records per week
added to it?


Compact and repair is in the same operation now unlike it was many years
ago so I would assume that it does a repair as well but don't worry, it
doesn't "repair" it like Access 2.0 used to do <g>.

Compacting has two effects that I can think off the top of my head:
1. It gets rid of deleted space in the database thereby (hopefully)
shrinking it.
2. It deletes the execution plan of saved queries so they'll get
recompiled the next time they're run.

Both are a good thing, the overhead of compiling an execution plan for a
query is small and you won't notice it without some sort of benchmark
and some very small fractions of seconds. As data changes, the original
execution plan of a query may not be the best one but Access will use it
if its been saved there.

I've not had to compact a database for a long time as I've only used SQL
Server back ends in recent years and the front ends are in StarTeam and
in constant development regularly requiring deletion and getting a whole
new version out of source control so I can't have any frame of reference
for regular compacting but think of it like washing the car, if it's
dirty, clean it. If it's been parked in the garage all week then washing
it won't harm it but it's a bit pointless at that time.

Oh, nearly forgot, there is a regular compact I do, the one in XP where
MS are sorry for the inconvenience and it compacts it for me.

--
1f u c4n r34d th1s u r34lly
n33d t0 g37 l41d

Nov 13 '05 #2
Thanks for the helpful info Trevor.

Nov 13 '05 #3
Trevor Best <no****@besty.org.uk> wrote in
news:42***********************@news.zen.co.uk:
Compact and repair is in the same operation now unlike it was many
years ago so I would assume that it does a repair as well but
don't worry, it doesn't "repair" it like Access 2.0 used to do
<g>.


If I'm remembering correctly, MichKa told us that with Jet 3.5 SP2,
every compact checked to see if a repair was necessary and then ran
it if it was necessary. It did *not* run it if there was nothing to
repair, as under certain circumstances, a repair could actually
*damage* a perfectly valid database.

"Repair" is obsolete. Don't use it.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #4
Trevor Best <no****@besty.org.uk> wrote in
news:42***********************@news.zen.co.uk:
Compacting has two effects that I can think off the top of my
head: 1. It gets rid of deleted space in the database thereby
(hopefully) shrinking it.
2. It deletes the execution plan of saved queries so they'll get
recompiled the next time they're run.


It also rewrites tables with a PK in PK order.

And it also cleans up the data pages of indexes, putting those in
order.

Both of these things can improve performance, especially with large
tables.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: James Franklin | last post by:
Hi, I have a number of databases in A2K, written on different machines with different installations of Office. I have found that compacting a database while it is open regularly fails, seemingly...
13
by: Larry L | last post by:
Access is noted for bloating a database when you add and delete records frequently. I have always had mine set to compact on close, and that works great. Now after everyone's advice I split my...
1
by: ColinWard | last post by:
Hello everyone. happy new year. I am trying to code an exit button for my application so that it automatically compacts the database when the user exits the app. Is this necessary or does the...
1
by: smitty mittlebaum | last post by:
I have a strange problem that has reared its ugly head in the last few weeks. I have the option "Compact on Close" (Tools, Options, General tab) enabled on my development machine. I did this...
1
by: Mark | last post by:
Hi all, I have a Access 2002 FE/BE scenario where the BE is stored on a network drive. Due to the amount of importing/deleting, the database bloats quite a lot. UP until now, I have been booting...
1
by: robert demo via AccessMonster.com | last post by:
In my startup routine, I have the following code: s = CLng(FileLen(filespec) / 1000000) If s > 5 Then 'FIRST, BACKUP THE FRONT END If BackupFrontEnd = False Then Exit Function End If
6
by: MLH | last post by:
I just used Tools / Database Utilities / Compact Database in Access 97 for the first time. Unlike Access 2.0, it does not ask me to furnish a filename for it to compact into. It just launched...
29
by: Neil | last post by:
I would like to compact on close only if the database size goes over a certain amount, rather than each time. Thus, I'd like to check the file size and then perform the compact through code as the...
0
by: ARC | last post by:
Hello all, Due to some users experiencing severe front end bloating (Normal compacted front end .accdr is 27MB's, FE can bloat to 80-90+Mb's in a day), I want to enable the "Compact on Close"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.