Showing posts with label performance. Show all posts
Showing posts with label performance. Show all posts

Friday, March 30, 2012

Linking Oracle view to SQL Server express

Hi,

I was able to link SQL Server Express to Oracle views using Linked Manager. However, when I run the query, the performance is very slow.

Is there a way to improve performance in querying?

Previously I was using Access to link to Oracle view. But the performance is not good. Takes about 8 hours for approx 6000 records.

Thanks a lot,

Stara

Which driver did you use ? Its long ago that I worked with Oracle linked servers, but you should use the Oracle driver which comes with the clint installation of Oracle rather than the MS one. You could also try to use an Openquery rather than the direct view as this statememt is directly executed on the Oracle system and is not further translated through the driver tier. Are you executing a complicate query whereas calculations are done on the Oracle or SQL Server side ?

Jens K. Suessmeyer


http://www.sqlserver2005.de|||

I have used MSDAORA. How do I use OpenQuery. Can you please provide an example?

Thanks,

Stara

|||

You are using the MS Oracle driver, as Jens suggestions you might consider using the driver provided by Oracle. You can find an example of using Openquery in BOL, the topic is here. When ever you're looking for an example of how to use a specific function, it's a good idea to search BOL first since all T-SQL commands are documented there.

Regards,

Mike

sql

Linking Oracle view to SQL Server express

Hi,

I was able to link SQL Server Express to Oracle views using Linked Manager. However, when I run the query, the performance is very slow.

Is there a way to improve performance in querying?

Previously I was using Access to link to Oracle view. But the performance is not good. Takes about 8 hours for approx 6000 records.

Thanks a lot,

Stara

Which driver did you use ? Its long ago that I worked with Oracle linked servers, but you should use the Oracle driver which comes with the clint installation of Oracle rather than the MS one. You could also try to use an Openquery rather than the direct view as this statememt is directly executed on the Oracle system and is not further translated through the driver tier. Are you executing a complicate query whereas calculations are done on the Oracle or SQL Server side ?

Jens K. Suessmeyer


http://www.sqlserver2005.de|||

I have used MSDAORA. How do I use OpenQuery. Can you please provide an example?

Thanks,

Stara

|||

You are using the MS Oracle driver, as Jens suggestions you might consider using the driver provided by Oracle. You can find an example of using Openquery in BOL, the topic is here. When ever you're looking for an example of how to use a specific function, it's a good idea to search BOL first since all T-SQL commands are documented there.

Regards,

Mike

Linking Oracle view to SQL Server express

Hi,

I was able to link SQL Server Express to Oracle views using Linked Manager. However, when I run the query, the performance is very slow.

Is there a way to improve performance in querying?

Previously I was using Access to link to Oracle view. But the performance is not good. Takes about 8 hours for approx 6000 records.

Thanks a lot,

Stara

Which driver did you use ? Its long ago that I worked with Oracle linked servers, but you should use the Oracle driver which comes with the clint installation of Oracle rather than the MS one. You could also try to use an Openquery rather than the direct view as this statememt is directly executed on the Oracle system and is not further translated through the driver tier. Are you executing a complicate query whereas calculations are done on the Oracle or SQL Server side ?

Jens K. Suessmeyer


http://www.sqlserver2005.de|||

I have used MSDAORA. How do I use OpenQuery. Can you please provide an example?

Thanks,

Stara

|||

You are using the MS Oracle driver, as Jens suggestions you might consider using the driver provided by Oracle. You can find an example of using Openquery in BOL, the topic is here. When ever you're looking for an example of how to use a specific function, it's a good idea to search BOL first since all T-SQL commands are documented there.

Regards,

Mike

Friday, March 23, 2012

servers question?

Hi All,
We have a linked server to an Oracle database. The query
performance was very slow, so I recreated the linked
server and set (check the checkbox) the "Index As Access
Path" in the Provider Options to see if the query
performance would improve. Now, when I try to run the
query, it gives me the following error message:
=========== OLE DB provider 'MSDAORA' returned a 'NON-CLUSTERED and
NOT INTEGRATED' index 'PKADDRESS' with incorrect bookmark
ordinal 0.
OLE DB error trace [Non-interface error: OLE/DB provider
returned an invalid bookmark ordinal from the index
rowset.].
===========
Any idea what this mean? I can't find any information on
what that "Index As Access Path" does.
Thanks in advance for any help or suggestions!
--AllanThe Index as Access Path is used for providers that support index seeks.
Most providers do not.
Rand
This posting is provided "as is" with no warranties and confers no rights.

Wednesday, March 21, 2012

servers Performance

I'm wondering if there's an issue of performance between two linked SQL
servers no matter the distance?
Depends on the OLEDB provider properties and specific linked server
properties.
Distance is just another latency added to the mix.
Sincerely,
Anthony Thomas

"Nery Gonzalez" <nery_gonzalez@.hotmail.com> wrote in message
news:eW4Kn5mhFHA.3692@.TK2MSFTNGP09.phx.gbl...
I'm wondering if there's an issue of performance between two linked SQL
servers no matter the distance?
sql

servers Performance

I'm wondering if there's an issue of performance between two linked SQL
servers no matter the distance?Depends on the OLEDB provider properties and specific linked server
properties.
Distance is just another latency added to the mix.
Sincerely,
Anthony Thomas
"Nery Gonzalez" <nery_gonzalez@.hotmail.com> wrote in message
news:eW4Kn5mhFHA.3692@.TK2MSFTNGP09.phx.gbl...
I'm wondering if there's an issue of performance between two linked SQL
servers no matter the distance?

servers Performance

I'm wondering if there's an issue of performance between two linked SQL
servers no matter the distance?Depends on the OLEDB provider properties and specific linked server
properties.
Distance is just another latency added to the mix.
Sincerely,
Anthony Thomas
"Nery Gonzalez" <nery_gonzalez@.hotmail.com> wrote in message
news:eW4Kn5mhFHA.3692@.TK2MSFTNGP09.phx.gbl...
I'm wondering if there's an issue of performance between two linked SQL
servers no matter the distance?

servers and performance

Hi,
I have a client that he needs to configure a linked server
on a server cluster with SQL Server 2000, windows 2000,
two instances: one default and one named instance.
Linked Server should be configured in the named instance
calling a database from default instance
There is any problem about performance using linked server
in that condition?
Thank's for information
I was searching in Microsoft pages and I didn't find
information over that topicsThere are no performance issues specific to that configuration. There is
the general consideration that remote queries use more resources and
encounter greater latency than local queries, so if a high percentage of
requests involve both servers then you could experience poor performance.
There is no specific guidance on when you would see a problem, but absent
real data I always use 80/20 as a rule of thumb. That is, 80% of the
requests should be completely satisfied locally and no more than 20% should
require access to the linked server. I use 90/10 when I need to make a more
conservative estimate.
--
Hal Berenson, SQL Server MVP
True Mountain Group LLC
"ruth G" <caubd@.isa.com.co> wrote in message
news:007301c36801$f96d1f00$a401280a@.phx.gbl...
> Hi,
> I have a client that he needs to configure a linked server
> on a server cluster with SQL Server 2000, windows 2000,
> two instances: one default and one named instance.
> Linked Server should be configured in the named instance
> calling a database from default instance
> There is any problem about performance using linked server
> in that condition?
> Thank's for information
> I was searching in Microsoft pages and I didn't find
> information over that topicssql

Monday, March 12, 2012

server: Performance Issue with OpenQuery & SP best practices

We are using the linked server feature of SQL Server 2000 to execute queries
against SQL Server data source which is hosted on the remote computer. In
our analysis, it was found that OpenQuery() takes the a lot of time causing
the system to have a performance hit.
We are looking for the following answers:
a.. Is there any alternative to linked server in SQL Server to fetch the
recordset from the SQL database hosted on the remote machine?
b.. If we use linked server approach, then is there any way to optimize
OpenQuery() call?
c.. What are the best practices to write the stored procedures? Is it
recommended to use temporary tables and cursors?
Thanks
AshishAshish Sharma
> a.. Is there any alternative to linked server in SQL Server to fetch the
> recordset from the SQL database hosted on the remote machine?
Replications

> b.. If we use linked server approach, then is there any way to optimize
> OpenQuery() call?
Tunning the query.Make sure that you define proper indexes

> c.. What are the best practices to write the stored procedures? Is it
> recommended to use temporary tables and cursors?
It depends on your business requirements. You can use a temporary tables
within a stored procedure , however make sure that #table has indexes and a
stored
procedures does not get recompile each time as you calling it .
Cursors should be your last resort ,because you will be benefit from set
based solution in terms of perfomance
11
"Ashish Sharma" <ashish.sharma@.honeywell.com> wrote in message
news:%23M%23%23r5$nGHA.4604@.TK2MSFTNGP02.phx.gbl...
> We are using the linked server feature of SQL Server 2000 to execute
> queries
> against SQL Server data source which is hosted on the remote computer. In
> our analysis, it was found that OpenQuery() takes the a lot of time
> causing
> the system to have a performance hit.
>
> We are looking for the following answers:
> a.. Is there any alternative to linked server in SQL Server to fetch the
> recordset from the SQL database hosted on the remote machine?
> b.. If we use linked server approach, then is there any way to optimize
> OpenQuery() call?
> c.. What are the best practices to write the stored procedures? Is it
> recommended to use temporary tables and cursors?
> Thanks
> Ashish
>
>|||Ashish Sharma wrote:
> We are using the linked server feature of SQL Server 2000 to execute queri
es
> against SQL Server data source which is hosted on the remote computer. In
> our analysis, it was found that OpenQuery() takes the a lot of time causin
g
> the system to have a performance hit.
>
> We are looking for the following answers:
> a.. Is there any alternative to linked server in SQL Server to fetch the
> recordset from the SQL database hosted on the remote machine?
> b.. If we use linked server approach, then is there any way to optimize
> OpenQuery() call?
> c.. What are the best practices to write the stored procedures? Is it
> recommended to use temporary tables and cursors?
> Thanks
> Ashish
>
>
You first need to identify why it takes so long for the OPENQUERY query
to complete. Are the necessary indexes in place on the remote table(s)
to support the query? How much data is the query returning? You're
essentially copying data over the network, the more data to move, the
longer it's going to take.
Tracy McKibben
MCDBA
http://www.realsqlguy.com

server: Performance Issue with OpenQuery & SP best practices

We are using the linked server feature of SQL Server 2000 to execute queries
against SQL Server data source which is hosted on the remote computer. In
our analysis, it was found that OpenQuery() takes the a lot of time causing
the system to have a performance hit.
We are looking for the following answers:
a.. Is there any alternative to linked server in SQL Server to fetch the
recordset from the SQL database hosted on the remote machine?
b.. If we use linked server approach, then is there any way to optimize
OpenQuery() call?
c.. What are the best practices to write the stored procedures? Is it
recommended to use temporary tables and cursors?
Thanks
AshishAshish Sharma
> a.. Is there any alternative to linked server in SQL Server to fetch the
> recordset from the SQL database hosted on the remote machine?
Replications
> b.. If we use linked server approach, then is there any way to optimize
> OpenQuery() call?
Tunning the query.Make sure that you define proper indexes
> c.. What are the best practices to write the stored procedures? Is it
> recommended to use temporary tables and cursors?
It depends on your business requirements. You can use a temporary tables
within a stored procedure , however make sure that #table has indexes and a
stored
procedures does not get recompile each time as you calling it .
Cursors should be your last resort ,because you will be benefit from set
based solution in terms of perfomance
11
"Ashish Sharma" <ashish.sharma@.honeywell.com> wrote in message
news:%23M%23%23r5$nGHA.4604@.TK2MSFTNGP02.phx.gbl...
> We are using the linked server feature of SQL Server 2000 to execute
> queries
> against SQL Server data source which is hosted on the remote computer. In
> our analysis, it was found that OpenQuery() takes the a lot of time
> causing
> the system to have a performance hit.
>
> We are looking for the following answers:
> a.. Is there any alternative to linked server in SQL Server to fetch the
> recordset from the SQL database hosted on the remote machine?
> b.. If we use linked server approach, then is there any way to optimize
> OpenQuery() call?
> c.. What are the best practices to write the stored procedures? Is it
> recommended to use temporary tables and cursors?
> Thanks
> Ashish
>
>|||Ashish Sharma wrote:
> We are using the linked server feature of SQL Server 2000 to execute queries
> against SQL Server data source which is hosted on the remote computer. In
> our analysis, it was found that OpenQuery() takes the a lot of time causing
> the system to have a performance hit.
>
> We are looking for the following answers:
> a.. Is there any alternative to linked server in SQL Server to fetch the
> recordset from the SQL database hosted on the remote machine?
> b.. If we use linked server approach, then is there any way to optimize
> OpenQuery() call?
> c.. What are the best practices to write the stored procedures? Is it
> recommended to use temporary tables and cursors?
> Thanks
> Ashish
>
>
You first need to identify why it takes so long for the OPENQUERY query
to complete. Are the necessary indexes in place on the remote table(s)
to support the query? How much data is the query returning? You're
essentially copying data over the network, the more data to move, the
longer it's going to take.
Tracy McKibben
MCDBA
http://www.realsqlguy.com

Friday, March 9, 2012

server/SQL Server OLE DB performance problem with parameters?

Hi,
I am interested if anyone else has come across performance problems with the SQL Server linked servers to SQL Server. I suspect that the OLE DB Provider that I am using perhaps has some performance issues when passed parameters.

I have set the dynamic paramters option on, and use collation compatible.Linked servers in general are a performance nightmare.

Get me that bucket of data over there...ALL of it.

Careful...carry it over here now. Be careful. Oh crap...I dropped some. You need to start over.

Great...it's finally here....ALL OF IT. Can you throw away everything that doesn't match this one value?

That's great. Thanks.|||Replace a straight DML/SELECT with a call to a stored procedure on the remote side and you'll be home free!|||SQL Attempts to retrieve statistics information from remote tables to determine which server should be the driving server - or where to filter rows first before joins. It runs some system stored procedures (I forget the names at the moment) If the account connecting to the remote server does not have permisisons on the procedures SQL will assume the worset and generate a query plan with the statistics available on the local server. I'm not recommending you grant the remote user dbo rights (not that I would do that ...) but if you did do it temporarily and saw a performance increase you could research exactly which permissions were really needed. Actually you can run profiler on the remote server and you will see the statistics gathering queries and identify the objects involved.|||In testing I found that the query performed faster with the parameters declared 'inline'. Does this make sense? Or am I suffering from inconsistent testing conditions? Our production databases are on the same servers as our test dbs.

The distributed queries are in stored procedures. And they (usually) don't join to the local server. However, the stored procs need to query the local db and store results there. It would be possible to put stored procs on the remote db. But we have already taken the functions into production so code changes are undesired.|||Try using the openquery() method. When this method is used the calling SQL server instance does not attempt to retrieve statistics info and the linked server processes the SQL and simply returns the results.

This especially makes a huge difference when the linked server is Sybase ASE.

server/OLE DB Performance problem with parameters?

Hey,
I have been getting some odd results when performance testing my distributed queries. Sometimes they go fast, sometimes slow.
When I translate the variables into constants, or execute the queries as dynamic sql they always go fast. Is anyone aware of performance problems with parameters in the SQL Server OLE DB Provider?
Cheers,
James
--
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.http://www.sql-server-performance.com/linked_server.asp for reference on performance of distributed queries.
HTH
"SqlJunkies User" wrote:
> Hey,
> I have been getting some odd results when performance testing my distributed queries. Sometimes they go fast, sometimes slow.
> When I translate the variables into constants, or execute the queries as dynamic sql they always go fast. Is anyone aware of performance problems with parameters in the SQL Server OLE DB Provider?
> Cheers,
> James
> --
> Posted using Wimdows.net NntpNews Component -
> Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
>

server/OLE DB Performance problem with parameters?

Hey,
I have been getting some odd results when performance testing my distributed queries. Sometimes they go fast, sometimes slow.
When I translate the variables into constants, or execute the queries as dynamic sql they always go fast. Is anyone aware of performance problems with parameters in the SQL Server OLE DB Provider?
Cheers,
James
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
http://www.sql-server-performance.com/linked_server.asp for reference on performance of distributed queries.
HTH
"SqlJunkies User" wrote:

> Hey,
> I have been getting some odd results when performance testing my distributed queries. Sometimes they go fast, sometimes slow.
> When I translate the variables into constants, or execute the queries as dynamic sql they always go fast. Is anyone aware of performance problems with parameters in the SQL Server OLE DB Provider?
> Cheers,
> James
> --
> Posted using Wimdows.net NntpNews Component -
> Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
>

server/OLE DB Performance problem with parameters?

Hey,
I have been getting some odd results when performance testing my distributed
queries. Sometimes they go fast, sometimes slow.
When I translate the variables into constants, or execute the queries as dyn
amic sql they always go fast. Is anyone aware of performance problems with p
arameters in the SQL Server OLE DB Provider?
Cheers,
James
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine sup
ports Post Alerts, Ratings, and Searching.http://www.sql-server-performance.com/linked_server.asp for reference on per
formance of distributed queries.
HTH
"SqlJunkies User" wrote:

> Hey,
> I have been getting some odd results when performance testing my distribut
ed queries. Sometimes they go fast, sometimes slow.
> When I translate the variables into constants, or execute the queries as d
ynamic sql they always go fast. Is anyone aware of performance problems with
parameters in the SQL Server OLE DB Provider?
> Cheers,
> James
> --
> Posted using Wimdows.net NntpNews Component -
> Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine s
upports Post Alerts, Ratings, and Searching.
>

server, oledb for odbc, slow performance on join to cache

I have a sql linked server pointed to a cache database. I created it
using the oledb for odbc and pointed it to an odbc data source I
created using the intersystems odbc driver install. I can openquery the
database fine if i need to pull back specific record fine. But if i try
to join data between my sql database and cache it crawls. I created a
simple join between two tables, one in my sql database, the other in
the cache databse. I joined on a common indexed field and it too 12
minutes to pull back 600 records. i repeate the process in ms access,
which uses straigh odbc for its linked tables, and it returned the data
in 2 seconds. The sql execution planed showed that sql server is
pulling back all the records from cache and then comparing the data.
The cache table is huge and pulling all of it is why sql is going so
slow.
I tried changing some of the linked server setting like collation and
so on, but now changes. Does anyone have any ideas how to address this
issue (sql pulling the entire table from cache over and then comparing
the data) or does anyone know where I can get the OLEDB driver for
cache. Intersystems says there is one but I can't find it at their
site.
Thank you for any ideas. :-)
..
Hi
It is not clear if you are joining with OPENQUERY or a linked server e.g
SELECT a.au_id, t.title_id, a.au_fname, a.au_lname, t.title
FROM
OPENQUERY ( loopback, 'select au_id, au_fname, au_lname from pubs..authors') a
JOIN pubs..titleauthor ta on a.au_id = ta.au_id
JOIN pubs..titles t on t.title_id = ta.title_id
or
SELECT a.au_id, t.title_id, a.au_fname, a.au_lname, t.title
FROM loopback.pubs.dbo.authors a
JOIN pubs..titleauthor ta on a.au_id = ta.au_id
JOIN pubs..titles t on t.title_id = ta.title_id
But looking at your other posts it is the latter you are using. For an OLEDB
drive you should contact CACHE.
John
"steven@.ironcube.com" wrote:

> I have a sql linked server pointed to a cache database. I created it
> using the oledb for odbc and pointed it to an odbc data source I
> created using the intersystems odbc driver install. I can openquery the
> database fine if i need to pull back specific record fine. But if i try
> to join data between my sql database and cache it crawls. I created a
> simple join between two tables, one in my sql database, the other in
> the cache databse. I joined on a common indexed field and it too 12
> minutes to pull back 600 records. i repeate the process in ms access,
> which uses straigh odbc for its linked tables, and it returned the data
> in 2 seconds. The sql execution planed showed that sql server is
> pulling back all the records from cache and then comparing the data.
> The cache table is huge and pulling all of it is why sql is going so
> slow.
> I tried changing some of the linked server setting like collation and
> so on, but now changes. Does anyone have any ideas how to address this
> issue (sql pulling the entire table from cache over and then comparing
> the data) or does anyone know where I can get the OLEDB driver for
> cache. Intersystems says there is one but I can't find it at their
> site.
> Thank you for any ideas. :-)
> ..
>
|||Hi John,
I got posts all over this group this week as well as the cache. Sorry,
I didn't see that anyone got back to me on this one. I actually have
tried both syntax you mentioned above. I saw the same from both of
them. Very slow.
I contacted cache over the weekend and I'm hoping to see an email from
them soon in my inbox. If I do and the OLEdb driver helps (or doesn't)
I'm going to post back just so other in the same boat know what
happened.
Thanks for taking the time to post. I appreciate it. Have a good one.
:-)

server, oledb for odbc, slow performance on join to cache

I have a sql linked server pointed to a cache database. I created it
using the oledb for odbc and pointed it to an odbc data source I
created using the intersystems odbc driver install. I can openquery the
database fine if i need to pull back specific record fine. But if i try
to join data between my sql database and cache it crawls. I created a
simple join between two tables, one in my sql database, the other in
the cache databse. I joined on a common indexed field and it too 12
minutes to pull back 600 records. i repeate the process in ms access,
which uses straigh odbc for its linked tables, and it returned the data
in 2 seconds. The sql execution planed showed that sql server is
pulling back all the records from cache and then comparing the data.
The cache table is huge and pulling all of it is why sql is going so
slow.
I tried changing some of the linked server setting like collation and
so on, but now changes. Does anyone have any ideas how to address this
issue (sql pulling the entire table from cache over and then comparing
the data) or does anyone know where I can get the OLEDB driver for
cache. Intersystems says there is one but I can't find it at their
site.
Thank you for any ideas. :-)
.Hi
It is not clear if you are joining with OPENQUERY or a linked server e.g
SELECT a.au_id, t.title_id, a.au_fname, a.au_lname, t.title
FROM
OPENQUERY ( loopback, 'select au_id, au_fname, au_lname from pubs..authors') a
JOIN pubs..titleauthor ta on a.au_id = ta.au_id
JOIN pubs..titles t on t.title_id = ta.title_id
or
SELECT a.au_id, t.title_id, a.au_fname, a.au_lname, t.title
FROM loopback.pubs.dbo.authors a
JOIN pubs..titleauthor ta on a.au_id = ta.au_id
JOIN pubs..titles t on t.title_id = ta.title_id
But looking at your other posts it is the latter you are using. For an OLEDB
drive you should contact CACHE.
John
"steven@.ironcube.com" wrote:
> I have a sql linked server pointed to a cache database. I created it
> using the oledb for odbc and pointed it to an odbc data source I
> created using the intersystems odbc driver install. I can openquery the
> database fine if i need to pull back specific record fine. But if i try
> to join data between my sql database and cache it crawls. I created a
> simple join between two tables, one in my sql database, the other in
> the cache databse. I joined on a common indexed field and it too 12
> minutes to pull back 600 records. i repeate the process in ms access,
> which uses straigh odbc for its linked tables, and it returned the data
> in 2 seconds. The sql execution planed showed that sql server is
> pulling back all the records from cache and then comparing the data.
> The cache table is huge and pulling all of it is why sql is going so
> slow.
> I tried changing some of the linked server setting like collation and
> so on, but now changes. Does anyone have any ideas how to address this
> issue (sql pulling the entire table from cache over and then comparing
> the data) or does anyone know where I can get the OLEDB driver for
> cache. Intersystems says there is one but I can't find it at their
> site.
> Thank you for any ideas. :-)
> ..
>|||Hi John,
I got posts all over this group this week as well as the cache. Sorry,
I didn't see that anyone got back to me on this one. I actually have
tried both syntax you mentioned above. I saw the same from both of
them. Very slow.
I contacted cache over the weekend and I'm hoping to see an email from
them soon in my inbox. If I do and the OLEdb driver helps (or doesn't)
I'm going to post back just so other in the same boat know what
happened.
Thanks for taking the time to post. I appreciate it. Have a good one.
:-)|||Hi
I did not see an example of the first query in your previous post!
You may also want to specify only the column names required instead of (*)
which will reduce the size of the data being retrieved
SELECT X.ID, X.Col1, X.Col2
FROM OPENQUERY(Cache_test01, 'SELECT ID, col1, col2 FROM Table01 WHERE
ID=22 ') AS X
JOIN dbo.tblTable01AddOn A ON X.ID = A.ID
Have you tried using a temporary table to store the data from the openquery?
If the openquery can be restricted that should be better, although it may
mean resorting to dynamic SQL.
John
"steven@.ironcube.com" wrote:
> Hi John,
> I got posts all over this group this week as well as the cache. Sorry,
> I didn't see that anyone got back to me on this one. I actually have
> tried both syntax you mentioned above. I saw the same from both of
> them. Very slow.
> I contacted cache over the weekend and I'm hoping to see an email from
> them soon in my inbox. If I do and the OLEdb driver helps (or doesn't)
> I'm going to post back just so other in the same boat know what
> happened.
> Thanks for taking the time to post. I appreciate it. Have a good one.
> :-)
>

server, oledb for odbc, slow performance on join to cache

I have a sql linked server pointed to a cache database. I created it
using the oledb for odbc and pointed it to an odbc data source I
created using the intersystems odbc driver install. I can openquery the
database fine if i need to pull back specific record fine. But if i try
to join data between my sql database and cache it crawls. I created a
simple join between two tables, one in my sql database, the other in
the cache databse. I joined on a common indexed field and it too 12
minutes to pull back 600 records. i repeate the process in ms access,
which uses straigh odbc for its linked tables, and it returned the data
in 2 seconds. The sql execution planed showed that sql server is
pulling back all the records from cache and then comparing the data.
The cache table is huge and pulling all of it is why sql is going so
slow.
I tried changing some of the linked server setting like collation and
so on, but now changes. Does anyone have any ideas how to address this
issue (sql pulling the entire table from cache over and then comparing
the data) or does anyone know where I can get the OLEDB driver for
cache. Intersystems says there is one but I can't find it at their
site.
Thank you for any ideas. :-)
.Hi
It is not clear if you are joining with OPENQUERY or a linked server e.g
SELECT a.au_id, t.title_id, a.au_fname, a.au_lname, t.title
FROM
OPENQUERY ( loopback, 'select au_id, au_fname, au_lname from pubs..authors')
a
JOIN pubs..titleauthor ta on a.au_id = ta.au_id
JOIN pubs..titles t on t.title_id = ta.title_id
or
SELECT a.au_id, t.title_id, a.au_fname, a.au_lname, t.title
FROM loopback.pubs.dbo.authors a
JOIN pubs..titleauthor ta on a.au_id = ta.au_id
JOIN pubs..titles t on t.title_id = ta.title_id
But looking at your other posts it is the latter you are using. For an OLEDB
drive you should contact CACHE.
John
"steven@.ironcube.com" wrote:

> I have a sql linked server pointed to a cache database. I created it
> using the oledb for odbc and pointed it to an odbc data source I
> created using the intersystems odbc driver install. I can openquery the
> database fine if i need to pull back specific record fine. But if i try
> to join data between my sql database and cache it crawls. I created a
> simple join between two tables, one in my sql database, the other in
> the cache databse. I joined on a common indexed field and it too 12
> minutes to pull back 600 records. i repeate the process in ms access,
> which uses straigh odbc for its linked tables, and it returned the data
> in 2 seconds. The sql execution planed showed that sql server is
> pulling back all the records from cache and then comparing the data.
> The cache table is huge and pulling all of it is why sql is going so
> slow.
> I tried changing some of the linked server setting like collation and
> so on, but now changes. Does anyone have any ideas how to address this
> issue (sql pulling the entire table from cache over and then comparing
> the data) or does anyone know where I can get the OLEDB driver for
> cache. Intersystems says there is one but I can't find it at their
> site.
> Thank you for any ideas. :-)
> ..
>|||Hi John,
I got posts all over this group this week as well as the cache. Sorry,
I didn't see that anyone got back to me on this one. I actually have
tried both syntax you mentioned above. I saw the same from both of
them. Very slow.
I contacted cache over the weekend and I'm hoping to see an email from
them soon in my inbox. If I do and the OLEdb driver helps (or doesn't)
I'm going to post back just so other in the same boat know what
happened.
Thanks for taking the time to post. I appreciate it. Have a good one.
:-)

server view performance worse than not using view

Consider pseudo-DDL created on an "archive" machine, that wants to get data
from the "live" machine.
CREATE VIEW AllTransactions AS
SELECT * FROM Tranasction_Archived
UNION ALL
SELECT * FROM LinkedServerToLive.Northwind.dbo.Transactions
Now ideally, you can query the Transactions view on the archive machine:
SELECT *
FROM AllTransactions t
INNER JOIN Customers c
ON t.cid = c.cid
and get presented a unified result set. But it turns out this performance is
horrible.
But, if you simply change your query to:
SELECT *
FROM Transactions_Archived t
INNER JOIN Customers c
ON t.cid = c.cid
UNION ALL
SELECT *
FROM LinkedServerToLive.Northwind.dbo.Transactions t
INNER JOIN Customers c
ON t.cid = c.cid
You will get a phenominal performance boost. All i did was break out what
the view contained,
and did the UNION ALL at the query level rather than abstract the complexity
into a view.
i am using SQL2000, is this a known optimizer failing that is fixed in
SQL2005?What are the differences in the execution plans? Are indexes being used to
their full advantage on the joins for both queries?
"Ian Boyd" wrote:

> Consider pseudo-DDL created on an "archive" machine, that wants to get dat
a
> from the "live" machine.
> CREATE VIEW AllTransactions AS
> SELECT * FROM Tranasction_Archived
> UNION ALL
> SELECT * FROM LinkedServerToLive.Northwind.dbo.Transactions
> Now ideally, you can query the Transactions view on the archive machine:
> SELECT *
> FROM AllTransactions t
> INNER JOIN Customers c
> ON t.cid = c.cid
> and get presented a unified result set. But it turns out this performance
is
> horrible.
> But, if you simply change your query to:
> SELECT *
> FROM Transactions_Archived t
> INNER JOIN Customers c
> ON t.cid = c.cid
> UNION ALL
> SELECT *
> FROM LinkedServerToLive.Northwind.dbo.Transactions t
> INNER JOIN Customers c
> ON t.cid = c.cid
> You will get a phenominal performance boost. All i did was break out what
> the view contained,
> and did the UNION ALL at the query level rather than abstract the complexi
ty
> into a view.
> i am using SQL2000, is this a known optimizer failing that is fixed in
> SQL2005?
>
>|||My understanding, from a logical perspective, is this (see disclaimer
below)...
Regardless of your DBMS product, if you are using Oracle DB links or Linked
Servers in SQL Server, or some other artificial method to make DatabaseA
access a table in DatabaseB as if the tables were in the same database, then
the standard tuning mechanisms can no longer be used.
Basically, DatabaseA knows nothign about the tables in DatabaseB, and the
best it can do is link one column in the source database to the result set
in the remote database. IF the remote database has a view, the view cannot
be broken down efficiently into its parts, as it would if the databases were
the same. The remote database ends up processing the entire view in order
to return one row (although it may use an index based on criteria passed).
If the view were in the same database, then the tuning engine would
essentially rewrite the SQL and process the individual joins more
efficiently.
Think of it like going to the library and getting 5 books that you want, as
compared to submitting 5 requests for someone else to get the book, all of
which get handled seperately.
As usual, I am speaking regarding my own limited understanding of the SQL
Server engine. If anyone knows differently, or can explain it better,
please do.
"Ian Boyd" <ian.msnews010@.avatopia.com> wrote in message
news:%23wziZJfIGHA.532@.TK2MSFTNGP15.phx.gbl...
> Consider pseudo-DDL created on an "archive" machine, that wants to get
data
> from the "live" machine.
> CREATE VIEW AllTransactions AS
> SELECT * FROM Tranasction_Archived
> UNION ALL
> SELECT * FROM LinkedServerToLive.Northwind.dbo.Transactions
> Now ideally, you can query the Transactions view on the archive machine:
> SELECT *
> FROM AllTransactions t
> INNER JOIN Customers c
> ON t.cid = c.cid
> and get presented a unified result set. But it turns out this performance
is
> horrible.
> But, if you simply change your query to:
> SELECT *
> FROM Transactions_Archived t
> INNER JOIN Customers c
> ON t.cid = c.cid
> UNION ALL
> SELECT *
> FROM LinkedServerToLive.Northwind.dbo.Transactions t
> INNER JOIN Customers c
> ON t.cid = c.cid
> You will get a phenominal performance boost. All i did was break out what
> the view contained,
> and did the UNION ALL at the query level rather than abstract the
complexity
> into a view.
> i am using SQL2000, is this a known optimizer failing that is fixed in
> SQL2005?
>|||"Mark Williams" <MarkWilliams@.discussions.microsoft.com> wrote in message
news:B88552FB-15AD-443B-ACC9-8A8269741E50@.microsoft.com...
> What are the differences in the execution plans? Are indexes being used to
> their full advantage on the joins for both queries?
It looks as though in the slow case, SQL Server is performing tens of
thounds of executes on a single-row returning query, verses bringing back
tens of thousands of rows.
i would have posted the showplan_text outputs, but it did not show the
number of executes or rows returned through each step.

Wednesday, March 7, 2012

server to sybase database

Hi
I created linked server to sybase database using adaptive server odbc driver.
But the performance sucks while loading large tables even after manipulating
performance tab in odbc driver.
Can anyone suggest some tuning work on linked server environment to sybase.
Thanks for your wonderful help
Praveen Mohan
Hi
What do you regard as "suck"?
If you are pulling 1'000'000 records, you are limited by your network
performance.
How many records are you dealing with? is the linked server a part of a JOIN
query?
Regards
Mike
"PraveenMohan" wrote:

> Hi
> I created linked server to sybase database using adaptive server odbc driver.
> But the performance sucks while loading large tables even after manipulating
> performance tab in odbc driver.
> Can anyone suggest some tuning work on linked server environment to sybase.
> Thanks for your wonderful help
> Praveen Mohan
|||Also, it can be really revealing to look at the query plan when you go against a linked server. Some
manual optimization can be applied using OPENQUERY instead of 4-part table naming. For example,
pushing a WHERE predicate inside the OPENQUERY function to you know for sure the filtering is
performed at the remote site.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:3D332524-E849-4449-B2BD-15BB443BE6F1@.microsoft.com...[vbcol=seagreen]
> Hi
> What do you regard as "suck"?
> If you are pulling 1'000'000 records, you are limited by your network
> performance.
> How many records are you dealing with? is the linked server a part of a JOIN
> query?
> Regards
> Mike
> "PraveenMohan" wrote:
|||Praveen
Can you describe how did you do that?
I am having the problem with setting up my connection so your input will be
very helpfull.
Thank you, Gene.
"PraveenMohan" wrote:

> Hi
> I created linked server to sybase database using adaptive server odbc driver.
> But the performance sucks while loading large tables even after manipulating
> performance tab in odbc driver.
> Can anyone suggest some tuning work on linked server environment to sybase.
> Thanks for your wonderful help
> Praveen Mohan

server to sybase database

Hi
I created linked server to sybase database using adaptive server odbc driver.
But the performance sucks while loading large tables even after manipulating
performance tab in odbc driver.
Can anyone suggest some tuning work on linked server environment to sybase.
Thanks for your wonderful help
Praveen MohanAlso, it can be really revealing to look at the query plan when you go against a linked server. Some
manual optimization can be applied using OPENQUERY instead of 4-part table naming. For example,
pushing a WHERE predicate inside the OPENQUERY function to you know for sure the filtering is
performed at the remote site.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:3D332524-E849-4449-B2BD-15BB443BE6F1@.microsoft.com...
> Hi
> What do you regard as "suck"?
> If you are pulling 1'000'000 records, you are limited by your network
> performance.
> How many records are you dealing with? is the linked server a part of a JOIN
> query?
> Regards
> Mike
> "PraveenMohan" wrote:
>> Hi
>> I created linked server to sybase database using adaptive server odbc driver.
>> But the performance sucks while loading large tables even after manipulating
>> performance tab in odbc driver.
>> Can anyone suggest some tuning work on linked server environment to sybase.
>> Thanks for your wonderful help
>> Praveen Mohan|||Hi
What do you regard as "suck"?
If you are pulling 1'000'000 records, you are limited by your network
performance.
How many records are you dealing with? is the linked server a part of a JOIN
query?
Regards
Mike
"PraveenMohan" wrote:
> Hi
> I created linked server to sybase database using adaptive server odbc driver.
> But the performance sucks while loading large tables even after manipulating
> performance tab in odbc driver.
> Can anyone suggest some tuning work on linked server environment to sybase.
> Thanks for your wonderful help
> Praveen Mohan|||Praveen
Can you describe how did you do that?
I am having the problem with setting up my connection so your input will be
very helpfull.
Thank you, Gene.
"PraveenMohan" wrote:
> Hi
> I created linked server to sybase database using adaptive server odbc driver.
> But the performance sucks while loading large tables even after manipulating
> performance tab in odbc driver.
> Can anyone suggest some tuning work on linked server environment to sybase.
> Thanks for your wonderful help
> Praveen Mohan