"BillCo" <coleman.bill@gmail.com> wrote in
news:1120212868.178881.18050@g49g2000cwa.googlegro ups.com:
[color=blue]
>
> I'm using a backend that's been around for years before I joined
> the company. It kind of grew exponentially and has some design
> problems including large unused tables some temporary tables. It
> compacts to 150Mb, but after a day it's up to 300Mb and it gros
> steadily from there. I need to:
> (a) reduce the size
> (b) reduce the bloat factor
>
> Apart from moving the temporary tables to front end (which can't
> possibly account for all of the this bloat) and emptying/deleting
> unused tables does anybody have any helpful suggestions? Any good
> online guides to common causes of backend bloat etc?[/color]
As Larry says, do *not* put the temp tables in the front end, but in
a separate MDB on the workstation alongside the front end.
If you have issues with relinking the front end to multiple back
ends, you could try my Reconnect code that is specifically designed
for handling multiple back ends (it handles only MDB links, though I
had laid the groundwork in the design for handling Excel
spreadsheets and dBase files). It's here:
http://www.dfenton.com/DFA/download/...Reconnect.html
[color=blue]
> Also if anyone has any
VB functions or queries for analysing all
> the table stats - size, usage etc that would be very helpful.[/color]
The amount of your bloat, 150 to 300, sounds like not all that much
to me. I've seen much worse. I would suggest that it could very
likely all be due to the temp tables.
Now, 150 sounds pretty big for the compacted size, unless you've got
100s of thousands of records in all your tables. Here are some
things to reduce bloat:
1. remove duplicate indexes. Here are some of the sources of
unnecessary duplicate indexes:
a. the setting that automatically indexes ID fields, etc.
b. creating a PK and indexing it and then converting it to a PK
field, which adds a second index.
c. creating relationships, which automatically creates hidden
indexes.
d. overzealous developers who put an index on every possible
field, instead of limiting it to the fields that are used for
searching/sorting/joining.
e. you may want to remove indexes on fields with few unique
values (which is called a "sparsely populated" index), or a high
proportion of NULLs, but I've found that this advice often leads
to significant slowdowns in WHERE clauses on those fields. A
perfect example would be a Boolean field, but I've found that
leaving the indexes on those fields gives a noticeable speed
boost, and that with enough records involved, removing them leads
to significant problematic loss of speed.
f. on compound keys, remove any index declared only on the first
field of the compound PK, because Jet will use the compound key's
index for searches on the first field (because it's going to be
stored in the order of the first column). So, if it's a
two-column compound key (i.e., with a compound index on the two
fields), you only need to declare an explicit index on the second
field. So, the number of indexes is always N-1, where N is the
number of columns in the compound key.
You can see what indexes there are on each table by using the
documentation wizard. The first time I did this, I was shocked by
what I found the first time I did this, and ended up reducing a 20MB
back end to under 15MBs, just by removing the duplicate and unused
indexes.
2. create a fresh new MDB and import all the tables and
relationships. You might even want to go all the way and create the
tables and relationships from scratch in the new MDB and then append
the data. I can't think of a scenario where that would be better,
except my sense of voodoo about these things -- it always seems that
there are things lurking behind the scenes that I know nothing about
that get dragged along when you do an import.
However, that's much more likely with forms/reports/etc. because
they have compiled modules. With module-bearing objects, it's best
to decompile and compact before importing, since that would leave
the objects with no compiled code at all. And, best of all for this
is to use Application.SaveAsText and Application.LoadFromText, but
that's not for data.
3. if the back end is replicated and replication is no longer used,
unreplicated it. Here are some links with tools to help:
http://trigeminal.com/lang/1033/util...p?ItemID=-1#11 http://trigeminal.com/lang/1033/utility.asp?ItemID=7#7
For Access97, there's:
http://support.microsoft.com/kb/q153526/
And also:
http://www.pacificdb.com.au/MVP/Code/UnReplicate.htm
4. as you already, said, remove unused tables, but you should also
evaluate if the current table structure is properly normalized. If
there's lots of repeated data, it can add a lot to the size of
tables.
--
David W. Fenton
http://www.bway.net/~dfenton
dfenton at bway dot net
http://www.bway.net/~dfassoc