Re: Query Optimization

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Have not downloaded your sample, but the difference could be due to factors
such as Name AutoCorrect, subdatasheets, and so on.

Take a look at the Access Performance FAQ by Tony Toews, and work through
the issues he lists here:
http://www.granite.ab.ca/access/performancefaq.htm
It will be worth your while for the long term, and certainly could impact
your immediate issue.

If you want to work with the query plan in JET, these links should get you
started:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacbk02/html/odc_4009c15.asp
http://builder.com.com/5100-6388-5064388.html
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaraccessdev/html/ODC_MicrosoftOfficeDeveloperForumMicrosoftAccessMicrosoftJetDatabaseEngine.asp

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Milewskp" <Milewskp@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8E9D5F57-9A36-4A52-803A-7BEC13B87003@xxxxxxxxxxxxxxxx
I have two update queries in a Microsoft Access database with the same
SQL, but one runs in <0.003 sec and the other runs in >2.000 sec. The
second one is slower because it has a query plan that is not optimal
for the data currently in the database.

After I compact the database, I would expect the queries to be
recompiled so that they both run fast. In fact, the opposite is true -
both take >2.000 sec to run.

I have posted my database on: http://www.geocities.com/milewskp/ee/
(then click on FastSlowTX.zip ). When you extract and then open the
mdb file, you will see the two queries: qryFast and qrySlow.
Initially, qryFast is fast and qrySlow is slow, but after you compact
the database, they will both be slow.

My Question:
How can I redesign the query so that it runs in < 0.003sec after
compaction?


.



Relevant Pages

  • RE: Compacting MDB help
    ... The autoexec macro opens a ... The FrontEnd.mdb's main switchboard has a cbo to switch back end ... FECompact.mdb runs the few lines of code to compact the FrontEnd.mdb ... I'm quite certain that you can't Compact an open database from within itself ...
    (microsoft.public.access.modulesdaovba)
  • RE: Compacting MDB help
    ... This will cause the database to grow so Compacting ... not split off the tables from your FrontEnd. ... The FrontEnd.mdb's main switchboard has a cbo to switch back end ... FECompact.mdb runs the few lines of code to compact the FrontEnd.mdb ...
    (microsoft.public.access.modulesdaovba)
  • RE: Compacting MDB help
    ... not practical to have staffpersons open another database in order to switch ... When the front end opens, it goes directly to the main switchboard. ... the only reason why you would need to Compact the ...
    (microsoft.public.access.modulesdaovba)
  • Re: Access crashes when opening form
    ... Allen Browne - Microsoft MVP. ... You were correct in suspecting SP3. ... I've also had a problem with "compact on close" not working (it ... database works correctly there. ...
    (microsoft.public.access.forms)
  • Re: Compacting Backend Access Databases
    ... when I ran the procedure to compact ... use of the back-end database. ... Dim strBackendPathAndName As String ...
    (microsoft.public.access.modulesdaovba)