Rereading your post I see that I didn't really answer your question regarding where the equijoin is performed (sorry, was a little pressed for time). I think I have a better answer for you.
Quote:
|
quote:Then I perform an equijoin, joining the two tables, and return that as the resultsâ¦When this join executes, is it being done on the server, or is my computer getting all the records and all the max_revisions and joining them locally?
|
The term "table" here was confusing. I assume you mean the two snapshot recordsets returned by the two pass-through queries, and that you are joining the two pass-through queries in a third Jet Select query (QueryDef object) which returns your final result set, i.e. using the pass-through queries as if they were attached tables.) So there are really 3 relevant queries in your database window. Right?
Lets say the SQL statement of the Jet Select query that brings together the results of the two pass-through queries into a final result set looks something like:
SELECT Max_Rev.SomeField, Search_Results.SomeField
FROM Max_Rev INNER JOIN Search_Results ON Max_Rev.JoinField = Search_Results.JoinField;
with Max_Rev and Search_Results being your pass-through query definitions.
If this is the case, the Jet engine, and not SQL Server is performing the join after scanning both recordsets cached in a local buffer.
You can see this by viewing the query execution plan Jetâs query optimizer generates when the ShowPlan function is turned on. Hereâs the output after running the Jet Select query:
---------------------------------------------------------------------------------------------------------------
DATE: 06/17/04
VER: 4.00.8015
--- Query1 ---
- Inputs to Query -
Recordset
Recordset
- End inputs to Query -
01) Scan recordset
02) Scan recordset
03) Sort table '02)'
04) Inner Join table '01)' to result of '03)'
using temporary index
join expression "Search_Results.CustomerID=Max_Rev.CustomerID"
---------------------------------------------------------------------------------------------------------------
You can see that the two inputs to the Jet query are your snapshot recordsets cached in memory. After the recordsets are scanned, the Jet engine performs the equijoin using the join expression provided.
Again, a better way to go would be to create a single server object (like a stored procedure) that could perform all your query processing on the server, and then return a single, final result set back to Access via one pass-through query execution.
HTH,
Bob