Posted by Erland Sommarskog on 02/06/07 22:32
(vikram.mankar@gmail.com) writes:
> Would NOT EXISTS add any overhead to the query? The application
> logging data to the SQL server is using OLEDB and as a test is
> currently logging nearly 10000 rows in the table every minute. I was
> wondering if NOT EXISTS would actually slow down the INSERT.
I am a little confused here. In your original post you talked about an
Agent job and you even mentioned a cursor. Now you are talking about
an application that logs data.
But let's say that we are talking about application logging now. Then I
am curious: how come the application is (attempting to) logging duplicates?
As for the question as such, NOT EXISTS may add an overhead, but so will
an error that has to be rolled back.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
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
[Back to original message]
|