All Questions
Tagged with cursors execution-plan
6 questions
0
votes
1
answer
150
views
Job with a cursor is abnormally slow [closed]
I have a query that takes more than 9 hours to complete.
Looking at the execution plan, I find this high-cost operator (query plan link):
How can I improve this job?
2
votes
1
answer
669
views
Can't reduce cost of query plan and get rid of Key Lookup because of cursor
I have tried to create a non-clustered index on the fields that are in the output list which are created_by and Chk1002 .I don't have a column called Chk1002 anywhere .
I have read here that it has ...
2
votes
0
answers
976
views
Why does this SQL Server execution plan contain a snapshot cursor for a select statement?
Here is the situation. I have a fairly simple query. It returns ~22k rows:
select * from tbl_A
When I run this query in SSMS (2017 7.6), I get a fairly simple plan:
SELECT <= Clustered Index Scan (...
2
votes
2
answers
1k
views
sp_cursoropen chooses terrible execution plan
If I execute my (simple) query directly in SQL Server Management Studio...
SELECT auftrag_prod_soll.ID
FROM auftrag_prod_soll
WHERE auftrag_prod_soll.auftrag_produktion = 51621
AND ...
10
votes
4
answers
7k
views
Lots of "FETCH API_CURSOR0000..." on sp_WhoIsActive ( SQL Server 2008 R2 )
I have a strange situation. Using sp_whoisactive I can see this:
Ok, with this query, I can see what is triggering ( does this word exists in english? ) it:
SELECT c.session_id, c.properties, c....
5
votes
1
answer
2k
views
View SQL 2008 sp_cursorexecute Underlying Query and Execution Plan
I'm performance tuning a Dynamics AX application and see in a SQL trace a long-running, high-I/O query of the form exec sp_cursorexecute 1073742882 ... When I try and run that query in a new SQL ...