I have created a linked server to a non sql server database using the OLEDB
for ODBC provider.
When I issue a simple query such as:
select * from linked_server..schema.table_name where field1 = '111111'
It takes the same amount of time as:
select * from linked_server..schema.table_name
Looking at the execution plan the reason for this becomes obvious. The plan
always uses a table scan passing only the select portion of the query, and
then applies a filter with the where clause once ALL records have been
retrieved from the linked server.
Is there any way to override the execution plan and force it to pass through
the entire select statement, including the where clause, for the remote
server to process without using OPENQUERY?Having a stored procedure on the linked server, and calling it using 4-part
name acceptable in this case?
--
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Charles J Ryan" <charlesryan1@.msn.com> wrote in message
news:eNb9Bz6iEHA.3612@.TK2MSFTNGP12.phx.gbl...
> I have created a linked server to a non sql server database using the
OLEDB
> for ODBC provider.
> When I issue a simple query such as:
> select * from linked_server..schema.table_name where field1 = '111111'
> It takes the same amount of time as:
> select * from linked_server..schema.table_name
> Looking at the execution plan the reason for this becomes obvious. The
plan
> always uses a table scan passing only the select portion of the query, and
> then applies a filter with the where clause once ALL records have been
> retrieved from the linked server.
> Is there any way to override the execution plan and force it to pass
through
> the entire select statement, including the where clause, for the remote
> server to process without using OPENQUERY?
>|||"Narayana Vyas Kondreddi" <answer_me@.hotmail.com> wrote in message
news:e8RoPK7iEHA.340@.TK2MSFTNGP10.phx.gbl...
> Having a stored procedure on the linked server, and calling it using
> 4-part
> name acceptable in this case?
> --
> Vyas, MVP (SQL Server)
> http://vyaskn.tripod.com/
>
Unfortunately no.
The server being linked to does not support stored procedures.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment