I am currently querying two databases - One in SQL Server and one Oracle, to find records which are in one but not the other (essentially a reconcilliation) this is working fine in MS Access, using 2 passthrough queries to return the results of the 2 databases, then another query to find the data in one but not the other.
I decided to try the linked server approach as I thought this would give me enhanced performance - but strangely enough when I query the oracle database from MS Access the query takes about 22 seconds - whereas when I query the linked server from SQL Server the same query takes about 55 seconds.
The only difernce I can see is the passthrough query in MS Access is connecting using ODBC, an the linked server is connecting using Microsoft OLE DB Provider for Oracle.
Any ideas would be appreciated
You don't specify how you are querying the Oracle database but I would guess you are using a 4 part name query against the Oracle data source. Try changing your query to use OpenQuery instead. That is also closer to how a pass-through query in Access would execute.
-Sue
|||Thanks I will give it a go. Is using th 4 part name a bad way to query?
<edit> WOW that is much better thanks very much for your help </edit>
|||In and of itself, the four part name isn't necessarily a bad thing but you can send the query over to the server to be executed on the remote data source and force more processing, data filtering on the server. So you can push more processing off to the server. Some people have a hard time with Openquery as the flip side is that you aren't sending transact sql - you need to send the sql syntax used by the remote data source, the other database platform. I've found with Oracle data sources, it's generally better to just use Openquery.
-Sue
|||Sue - thanks very much you have been very helpful. My query now runs in under 15 seconds now.
No comments:
Post a Comment