"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam
please)> wrote in news:(E-Mail Removed):
> With MDB and ODBC linked tables, simple queries should be done on
> the server, not locally.
Many of the stored queries will automatically be handed off by Jet
for processing by the SQL Server -- SHOWPLAN and SQLTRACE
demonstrate this quite clearly. It's only the queries on which Jet
guesses wrong, or that depend on Access features that will require
local processing, and even then, that processing may be shared with
the server, particular when there are joins and WHERE clauses that
can be used to limit the result that is retrieved to the
workstation.
> Simplify them or use Views and make sure that you
> don't use VBA function in any JOIN or WHERE statements.
Well, those can be used without huge performance penalties *if*
there is filtering on the tables beyond the expression-based JOIN or
WHERE criteria. I recently upsized an app that used a complex
function to join and I was very afraid it would need to be
completely redesigned. But with SQL Server it runs orders of
magnitude faster (and I really mean orderS, plural -- it's almost
instantaneous whereas it used to take up to a minute), without any
changes. That is because the join is between a field that is a value
returned from a function that takes values from a table that is
filtered on other criteria, and the other side of the join is a
small, 6-row local table. Jet is very smart, and tells the SQL
Server to do everything that can be done on the server, and then
takes the small set of rows that result and then processes them
locally with what needs to be done locally.
I was surprised, but in retrospect, it makes perfect sense to me.
> Take a look with
> the SQL-Server Profiler to make sure that your queries are
> executed on the server, not locally.
Use Jet SHOWPLAN and SQLTRACE on the workstations along with
Profiler in order to get the whole picture. You might be surprised
at how much Jet gets right without any alteration (assuming you've
compacted the database after upsizing so that the saved queries will
all get recompiled for the SQL Server the next time they are
executed). And those queries that Jet guesses wrong on can easily be
converted to passthroughs or views or stored procedures.
--
David W. Fenton
http://www.dfenton.com/
usenet at dfenton dot com
http://www.dfenton.com/DFA/