Results 1 to 10 of 10
  1. #1
    rdougherty is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2016
    Location
    Michigan
    Posts
    107

    Database bloat, emptying and filling tables each day

    I am not finding the place where I read this (on this forum 1.5 years ago), but I was under the impression that one way to avoid database bloat after emptying and refilling the same table, such as at the beginning of each daily iteration of a job, was to avoid using:



    Code:
    docmd.openquery ("qry_name")
    and instead use:

    Code:
    d.execute ("qry_name")
    However, this does not always appear to be consistent, if it works at all (at avoiding bloat, that is).

    Is this understanding incorrect, incomplete, or completely inaccurate? *Note, each day sees the database go from 750mb to 1.5gb and I would prefer it not to do this. I understand that splitting the database is a possibility, but I would prefer not to do this if there is another way.

    Thanks

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    first thing you should do is split the database. Should you hit the 2 gig mark you will probably loose everything. You should also make constant backups at least until you figure out whats causing the db to double in size.

    I dont think using the docmd method or db.execute method should make any difference.

    I think we need a better description of what you have and what your doing.
    Is this a temporary table? Does the size come down when you compact and repair?

    One method is to use a temp database instead of a temp table.

  3. #3
    rdougherty is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2016
    Location
    Michigan
    Posts
    107
    I am gathering fresh datasets from a sales application, which is very unfriendly to complex reporting, and appending it anew each day to a table which has several updates etc. run against it to process the data. The tables get emptied out each time, so in that sense it is a temp table. But the structure is kept each time.

    I am essentially using imports and linked tables (to spreadsheets) to first gather the records for combining into the master table. Once appended there, processes are run against it, as stated above.

    Yes, the filesize does come down to 750mb each time I do so. I would simply prefer not to need to do this for every iteration of the job.

    If I split the DB and have my tbl_Master (where everything is dumped for p rocessing) in a BE DB, will that prevent the BE from bloat, or just the FE? The BE could very quickly go over 2gb in a couple days, otherwise. What happens at 2gb anyway? I know that recent access version have higher limits, but what are they? (#records & filesizes)

    Thanks,

  4. #4
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Agreed that you should split this db, for several reasons.
    1) the size of the Back End (data only) will come down relative to the db as a whole.
    2) development on the forms/reports/queries side will not affect the be, especially if that development introduces corruption.
    3) development on the fe can take place without locking down the be from concurrent use
    4) it is the only safe way to share the tables in a multi-user environment
    5) it is easier to back up the be on a frequent/continual basis
    There are others, but if that doesn't convince you, probably nothing will.

    If the data is entirely changed, then wiping the old and appending the new data is really your only choice with respect to having localized data (I presume there are no tables that you can link to instead). However, if you perform this process without using Transactions, you run the risk of deleting all and having the updates/appends fail, resulting in no data. Consider Updating what's there and appending what's new rather than what you're doing now.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Agree with both moke123 and micron.
    Splitting is an absolute necessity.
    A temp database or 'side end' is very useful for processing the new data.

    Using update for existing and append for new records is generally better than replacing all
    BUT it will still cause bloat and will take longer to run.

    Also be aware that repeatedly making and replacing tables will at some point cause instability and corruption may follow.

    To correct a point in the first post no Access database can be larger than 2GB. New versions have the same limit. 64 bit has the same size limit as 32 bit.
    Hit the limit and your file will be unusable and you may not be able to rescue the data from another source.
    However SQL SERVER BE files can be much bigger. Even the free Express version can go to 10GB and paid versions far more than that.
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  6. #6
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Aside from design development, there are many reasons why an Access db bloats; from OLE storage to DAO objects that are not 'destroyed'. I used to think the latter one simply had an effect on pc memory allocation/release, but that is apparently not the case. I have to take the word of others on this as I religiously close rs objects in addition to destroying those and other DAO type objects. As an oft repeated cause, "Temporary tables" no longer seems to mean a 'never replaced, always present' table for storing temporary data that's undergoing processing (which is no more deleterious than any other table). It now seems to mean a table that exists one minute but is gone in the next minute. Then again, the longer you live, the more words seem to get twisted to mean something else. Till is my pet peeve lately. It IS NOT short for "until", OK?

    While I never meant to suggest my method prevents bloat, I do believe constantly affecting the size of a table (10000 records one minute, 0 the next, 20000 the next, etc.) is more of a problem than the operations themselves. Albert Kallal (been around as long as Allen Browne and probably just as knowledgeable) states that record level locking (in Options>Client Settings, not at the form level) is a major cause for bloat. So the best advice I can give is Google it and make a list of the reasons you find, Then see if you're doing any of those 'bad' things.

  7. #7
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Albert Kallal (been around as long as Allen Browne and probably just as knowledgeable) states that record level locking (in Options>Client Settings, not at the form level) is a major cause for bloat.
    I'd definitely agree regarding Albert's knowledge level - but wasn't aware about record level locking in client settings was an issue in that respect - though I use No Locks there myself
    Do you have a reference where I can read more about this?
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  8. #8
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423

  9. #9
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Many thanks. Just read his comments & it makes perfect sense. Glad I haven't ever used it
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  10. #10
    rdougherty is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2016
    Location
    Michigan
    Posts
    107
    thanks to all of you. I will look into splitting the db so that everything functional is in the FE, while the biggest data table(s) sits in the BE. There is also one transitional table I use prior to posting the records to the Master table, which is no longer needed due to efficiencies I've applied. Removing that big table will help with size, of course.

    A couple points about this DB:
    It is not a user input DB at all.
    Multiple users never use it simultaneously
    It is a functional way to prepare reporting ONLY
    A "shell" db with all functions, but no data, can easily be kept as a backup. No need to back up data itself, per se.

    Also, I will look for and disable the record locking as suggested, and see if that makes any difference. EDIT: nvm, "Client SEttings/Advanced/Default record locking" appears to be off by default. That is not a contributing factor, I suppose.

    Thanks again,

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Database Bloat on DAO CommitTrans by 400 kb/commit
    By angeleumbra in forum Programming
    Replies: 7
    Last Post: 06-09-2022, 11:17 AM
  2. Back end database bloat
    By vicsaccess in forum Access
    Replies: 6
    Last Post: 06-14-2016, 12:22 PM
  3. Emptying a database of data
    By Lou_Reed in forum Access
    Replies: 2
    Last Post: 05-12-2015, 08:36 AM
  4. DB in development BLOAT
    By libraccess in forum Database Design
    Replies: 4
    Last Post: 12-05-2013, 10:58 PM
  5. Replies: 8
    Last Post: 11-01-2013, 01:59 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums