SQL Server Performance Forum – Threads Archive
Cursors always results in physical disk reads?
Hi there,<br /><br />I’m currently trying to figure out what I can do about the rather poorish <br />performance of cursors. The application can not be changed, so please don’t <br />suggest that <img src=’/community/emoticons/emotion-1.gif’ alt=’
If application can’t changed, take a look of Execution Plan to find out if any index are neccesary.
Luis Martin
Moderator
SQL-Server-Performance.com One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important
Bertrand Russell
All postings are provided “AS IS†with no warranties for accuracy.
But the question I’d really like to get an answer on, if you know the answer <img src=’/community/emoticons/emotion-1.gif’ alt=’

SQL will not realease memory to OS until unless it is requested and if your SQL Server is shared by other resources then you must opt memory settings on SQL to Min & Max values. If not leave the memory settings to dynamic. In theory sp_cursorexecute creates and populates a cursor from the execution plan created by sp_cursorprepare, this sp_cursorprepare compiles the Transact-SQL statement or batch associated with a cursor into an execution plan but does not create the cursor. MSDN refers
The complete functionality from these stored procedures is made available to SQL Server applications through the API functions they support. For example, the cursor functionality of the sp_cursor system stored procedures is made available to OLE DB applications through the OLE DB API cursor properties and methods, to ODBC applications through the ODBC cursor attributes and functions, and to DB-Library applications through the DB-Library Cursor Library.
To fetch the data SQL has to request the resource from disk to complete the procedure. Capture PERFMON counters for further assessment. Satya SKJ
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided “AS IS†with no rights for the sake of knowledge sharing.
]]>