Database Size

Flinn, Randal J 281 Reputation points
2022-04-15T14:22:30.837+00:00

I currently have a database that I have split. Queries, reports, etc. reside in a datase named FCA Analysis and is 1,152 KB. Tables reside in FAC Analysis_be and is 1,451,532 KB. The database is extremely slow (I am assuming due to the size). Are there efficiencies I can use to improve the overall performance? I am perfroming a Compact/Repair on close.

Thanks

Microsoft 365 and Office Access Development
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Albert Kallal 5,586 Reputation points
    2022-04-15T14:49:51.497+00:00

    Well, remember, if you compact + repair the applcation part (your front end with linked tables), that does NOT compact the back end database file.

    So, I would double (maybe triple) check, and do a compact + repair on the back end database. It might shrink a lot. And you can't do that data file compact + repair while users are working (and you wonder why so many developers are night owls!!! - we often have to do tasks that require no one else is working on or using the data!!!).

    So, check the above, and try a compact + repair on the back end.

    Since compact on close will ONLY deal with the front end?

    Then you have to have some type of schedule to do this task. It is possible to do this say by the task manager, and you setting up some kind of routine to do this. (maybe during the nightly backup).

    Performance:

    As a general rule, even as a access database grows, it should not effect performance "huge". However, the art of performance tuning is a BIG topic - one far beyond say this simple question + answer forum.

    However, there are a few things you can try, or do:

    First up, without question, try the compact + repair of the back end.

    Next:

    Try what is called a persistent connection (if you don't have one). While this sounds "fancy", it simple means that you want to "force" and "keep" open a connection from your front end applcation to the back end at all times.

    A super quick and easy way to test this? Open your applcation (with the linked tables). Then open "any" linked table from the nav pane. Now, try launching your form or report. You will often see 10x the performance increase. So try this quick test. If this test DOES solve your performance issues?

    Then on your main startup form, or some startup form you want to thus "force" a connection to remain open. You can do this by launching a bound form (to any back end table), and KEEP that form open. Another way is to declare a recordset variable as global, and open a table to that recordset on startup. As noted, this tip/trick does not always help, but often it can do wonders.

    Check for no existing linked tables, and also for a default printer set to a network printer, or even a non existing printer. So, have your default printer set to a local printer. Often we don't have a physical printer, so make your default printer say a local PDF printer, or XPS printer (just any default printer - non network one).

    This is a known issue, and when access loads a form (or report), it can often attempt to "talk" to the printer to get information about layout and printer abilities (EVEN when you not going to print anything - so this can really slow things down.

    And if you loading/launching a report with say a filter of some type, check if indexing is on that column used for that criteria.

    And speaking of criteria and filtering? Well, always try to ask the user for some information before launching a form.

    if you have say 250,000 invoices in the system? If you prompt the user to say

    What invoice to display?

    Then you can launch a form this way:

     dim InvoiceNum      as long
    
    ' form or prompt for invoice
    
    InvoiceNum = 13445
    

    docmd.OpenForm "frmInvoices",,,"InvoiceNumber = " & InvoiceNum

    So, in above, assuming we have a index on InvoiceNumber, then that form will ONLY load the one record. Even on a typical office network, and say 500,000 rows? That invoice form should load near instant, and Access will ONLY pull over the network the ONE record if you use that "where" clause of the OpenForm.

    In other words, limit the data you pull into a form.

    Anyway, try compacting the back end database, and try that persistent connection - that persistent connection trick tends to really help.

    Regards,
    Albert D. Kallal (Access MVP 2003-2017)
    Edmonton, Alberta Canada


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.