Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Deletes takes a long time, but CPU, Disk and RAM untroubled...why ?


Deletes takes a long time, but CPU, Disk and RAM untroubled...why ?

Author
Message
greg.bull
greg.bull
Old Hand
Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)

Group: General Forum Members
Points: 345 Visits: 301
Hi all,

Running SQL 2012 BI on a spanky new server with 2690 x 2 CPU, fast SSD, ramdisk for tempdb and 128GB RAM. I have a problem finding a performance bottleneck, in essence.

Deleting records on a where condition is a the simplest example, but some select queries exhibit this behaviour too, for part of their runtime. Back to the delete example!

If CPU idles at 3 or 4% whilst the delete is running.
And RAM use is 13GB of 128GB
And Disk is idling at a few K per second

Why does this delete operation take minutes ? Why wouldn't SQL use more resources to get the job done faster ?

Regards, Greg.
MarkusB
MarkusB
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4449 Visits: 4208
Deleting records on a where condition is a the simplest example, but some select queries exhibit this behaviour too, for part of their runtime.


What kind of behaviour are you talking about exactly? How many records do you select/delete?

Lots of things can cause slow performance.
Without having more detailed informations we can only guess. Can be missing indexes, too many indexes, locking and blocking issues, triggers getting activates etc.

Oh, and btw do you really have 2690 x 2 CPU's :-)?

Markus Bohse
greg.bull
greg.bull
Old Hand
Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)

Group: General Forum Members
Points: 345 Visits: 301
Hi Markus,

Yes, I see what you mean, but...

I'm running these query tests standalone so no other users in the way.

1) There are no triggers on the table
2) It's just 1 table
3) How could it be being blocked, I wonder ?

I suppose (regardless of the details of the query) I have a conceptual problem to get my head around - which is - why doesn't SQL use more of the resources on the server to do the job faster ?

All I can think of that might slow it down is some kind of locking.blocking - but I can't think where this might be coming from, when the behaviour is noted in a simple delete statement.
Bhuvnesh
Bhuvnesh
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2926 Visits: 4076
greg.bull (9/24/2013)
Why does this delete operation take minutes ? Why wouldn't SQL use more resources to get the job done faster ?
Can you post exec plan along with sql and table defintion .

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
Talib123
Talib123
SSC Veteran
SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)

Group: General Forum Members
Points: 217 Visits: 1332
What are the data types of the tsble, are there any large data types ie VARCHAR(MAX),TEXT etc.

What is the data size of the whole table.

Is it waiting to get exclusive access to the table

SELECT * from sys.sysprocesses where blocked <> 0.
Grant Fritchey
Grant Fritchey
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17586 Visits: 32265
Check sys.dm_exec_requests while the query is running to understand what is causing it to wait. That's the best method. Anything else is just guessing.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
TheSQLGuru
TheSQLGuru
SSCertifiable
SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)

Group: General Forum Members
Points: 5957 Visits: 8312
1) sp_whoisactive (sqlblog.com I think version 11.11 is latest)

2) track_waitstats_2005 (found in the sql server 2005 waits and queues white paper IIRC) to do a wait stats analysis

3) run a file IO stall analysis

Download my Tune Like a Guru presentation here: http://sqlsaturday.com/81/schedule.aspx. I have both file IO and waitstats stuff there. Every client I ever help out is taught to run those three things IMMEDIATELY and WITHOUT THOUGHT as the first response to a performance issue. One or more of them will point you in the right direction the vast majority of the time. I note they won't help you FIX a problem if you find it though! Cool

Best,

Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru at GMail
RBarryYoung
RBarryYoung
SSCrazy Eights
SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)

Group: General Forum Members
Points: 9438 Visits: 9517
greg.bull (9/24/2013)

...
If CPU idles at 3 or 4% whilst the delete is running.
And RAM use is 13GB of 128GB
And Disk is idling at a few K per second
...


How many cores are there?

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
greg.bull
greg.bull
Old Hand
Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)

Group: General Forum Members
Points: 345 Visits: 301
16 hyper threaded up to 32
greg.bull
greg.bull
Old Hand
Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)Old Hand (345 reputation)

Group: General Forum Members
Points: 345 Visits: 301
All I can think of here then is that some tasks (ie, a delete, or an insert exec) cannot be parallelised, regardless of server settings. So, in effect the bottleneck I'm seeing is CPU. Just a hunch really as 32 cores / 3 or 4% utilistation is about 1 core...

Thanks to everyone who contributed.

Regards, Greg.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search