Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Speed up queries

Status
Not open for further replies.

unclesvenno

Programmer
Sep 12, 2004
33
AU
Hello All,

Can anyone tell me if a query will execute quicker on linked tables on a seperate server if the queries are generated as "Queries" via the objects panel in the Access Database Window or as a String within the VBA code? If so what is the difference?

Thanks,
Uncle Svenno
 
When a saved query is executed for the first time, it is "compiled", ie the optimizer build and save a query plan.
Then when the query is executed again the plan is already build and the query will execute faster.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi PHV,

Thanks for taking the time to answer my question. Unfortunately I'm a little slow on the uptake sometimes, do you mean by this that it doesn't really matter either way? I am making an mde file which to my understanding compiles the code. So if I create an SQL query as a String variable in the code of an event as to creating the query through Access (ie with the Wizard or manually) they'll both be compiled and therefor they execute at the same speed?

Thanks again,
Uncle Svenno
 
Compiling your DB will not optimize the SQL string in a module. However, if the linked tables are in a separate RDBMS, your SQL string sent as a pass-through query would probably run faster than an Access query unless it was also a pass-through.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top