Re: SQLOLEDB vs Query Analyzer performance (not parameter sniffing)
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Wed, 19 Apr 2006 21:59:07 +0000 (UTC)
Mike Jansen (mjansen_nntp@xxxxxxxx) writes:
I'm running into an issue that I've seen in production and also reproduced
in a test environment:
1. Call to stored procedure from application via ADO takes a long time
2. Immediately calling the same stored procedure WITH SAME PARAMETERS from
Query Analyzer returns the results almost immediately.
Here is a quick test to run:
Before you run the query in QA, run this command:
SET ARITHABORT OFF
If my prediction is correct, you will now get a slow plan in QA as well.
Next is to try
DBCC FREEPROCCACHE
and with unchanged settings run from QA first and SQLOLEDB next.
QA runs with ARITHABORT ON by default, SQLOLEDB does not. ARITHABORT is
one these settings that affect the query plan. That is, you get one plan
with ARITHABORT ON, and one with it OFF. (For more details on this, see
http://www.karaszi.com/SQLServer/info_sp_recompile_set.asp.
The most likely reason is that you have an indexed view or an
indexed computed column in the game. For these to come in play,
ARITHABORT must be ON.
The way to address it, is to send SET ARITHABORT ON from the client
when you connect.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- SQLOLEDB vs Query Analyzer performance (not parameter sniffing)
- From: Mike Jansen
- SQLOLEDB vs Query Analyzer performance (not parameter sniffing)
- Prev by Date: Re: Can't connect to SQL server
- Next by Date: Re: Microsoft OLE DB Provider for SQL Server error '80040e31'
- Previous by thread: SQLOLEDB vs Query Analyzer performance (not parameter sniffing)
- Next by thread: Re: SQLOLEDB vs Query Analyzer performance (not parameter sniffing)
- Index(es):
Relevant Pages
|
|