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


High value of work files and Work table


High value of work files and Work table

Author
Message
WhiteLotus
WhiteLotus
Old Hand
Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)

Group: General Forum Members
Points: 393 Visits: 882
Hi All,

I monitor my sql server 2008 performance via Solarwind and I got a high number of work files and Worktable ...( worktable is created 865/sec )...

I wonder What should I do to lower the value down ?
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47435 Visits: 44405
Firstly, is that value a problem? Is it higher than usual? Is it causing problems?


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


WhiteLotus
WhiteLotus
Old Hand
Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)

Group: General Forum Members
Points: 393 Visits: 882
GilaMonster (8/19/2014)
Firstly, is that value a problem? Is it higher than usual? Is it causing problems?


Thanks for your response! appreciate it !

Yes I use SOLARWIND to monitor SQL Performance and It shows that Workfiles Created/Sec and Worktables created /sec are in CRITICAL status.

There is some information from SOLARWIND aboout workfiles :

"Work files could be used to store temporary results for hash joins and hash aggregates. The returned value should be less than 20. Tempdb work files are used in processing hash operations when the amount of data being processed is too large to fit into the available memory."

Possible problems: High values can indicate thrash in the tempdb file as well as poorly coded queries.

and This is some information from SOLARWIND aboout worktables (at the moment, the value is : 739/sec)

"Work tables could be used to store temporary results for query spool, lob variables, XML variables, and cursors. The returned value should be less than 20. Worktables are used for queries that use various spools (table spool, index spool, and so on."

Possible problems: High values could cause general slowdown.

I wonder what should I do ?
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45494 Visits: 39948
WhiteLotus (8/19/2014)
GilaMonster (8/19/2014)
Firstly, is that value a problem? Is it higher than usual? Is it causing problems?


Thanks for your response! appreciate it !

Yes I use SOLARWIND to monitor SQL Performance and It shows that Workfiles Created/Sec and Worktables created /sec are in CRITICAL status.

There is some information from SOLARWIND aboout workfiles :

"Work files could be used to store temporary results for hash joins and hash aggregates. The returned value should be less than 20. Tempdb work files are used in processing hash operations when the amount of data being processed is too large to fit into the available memory."

Possible problems: High values can indicate thrash in the tempdb file as well as poorly coded queries.

and This is some information from SOLARWIND aboout worktables (at the moment, the value is : 739/sec)

"Work tables could be used to store temporary results for query spool, lob variables, XML variables, and cursors. The returned value should be less than 20. Worktables are used for queries that use various spools (table spool, index spool, and so on."

Possible problems: High values could cause general slowdown.

I wonder what should I do ?


Start looking for "crap code" and fix it. ;-)

To be honest, though, if you have a lot of batch jobs or reporting requests on a busy machine, 20 seems like a low number especially in this day and age with all the bloody XML flying around.

I'd still check for performance challenged code, though.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
WhiteLotus
WhiteLotus
Old Hand
Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)

Group: General Forum Members
Points: 393 Visits: 882
Jeff Moden (8/19/2014)
WhiteLotus (8/19/2014)
GilaMonster (8/19/2014)
Firstly, is that value a problem? Is it higher than usual? Is it causing problems?


Thanks for your response! appreciate it !

Yes I use SOLARWIND to monitor SQL Performance and It shows that Workfiles Created/Sec and Worktables created /sec are in CRITICAL status.

There is some information from SOLARWIND aboout workfiles :

"Work files could be used to store temporary results for hash joins and hash aggregates. The returned value should be less than 20. Tempdb work files are used in processing hash operations when the amount of data being processed is too large to fit into the available memory."

Possible problems: High values can indicate thrash in the tempdb file as well as poorly coded queries.

and This is some information from SOLARWIND aboout worktables (at the moment, the value is : 739/sec)

"Work tables could be used to store temporary results for query spool, lob variables, XML variables, and cursors. The returned value should be less than 20. Worktables are used for queries that use various spools (table spool, index spool, and so on."

Possible problems: High values could cause general slowdown.

I wonder what should I do ?


Start looking for "crap code" and fix it. ;-)

To be honest, though, if you have a lot of batch jobs or reporting requests on a busy machine, 20 seems like a low number especially in this day and age with all the bloody XML flying around.

I'd still check for performance challenged code, though.


Hi jeff,

Thanks!

How do I know which query or StoreProc that has crap code because there are hundreds of StoreProc?
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47435 Visits: 44405
WhiteLotus (8/24/2014)
How do I know which query or StoreProc that has crap code because there are hundreds of StoreProc?


You don't.

This is one of the flaws at looking at just perfmon counters. Sure, work tables are 'high', but you haven't said if they're higher than normal or if they're causing problems (don't use the tools blindly).
Performance analysis is never about one counter. There's no one counter or value that tells you everything. It's about looking at the whole system, perfmon counters, wait stats, query execution statistics and drawing conclusions from all of them together.

The perfmon counters, with very few exceptions don't have good or bad thresholds. They have 'normal' and 'not normal' for your server. The wait stats tell you what, in general, SQL is spending time waiting for during query executions and the query stats tell you which are your most resource-intensive queries overall.


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Eirikur Eiriksson
Eirikur Eiriksson
SSCertifiable
SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)

Group: General Forum Members
Points: 6844 Visits: 17777
WhiteLotus (8/19/2014)

Yes I use SOLARWIND to monitor SQL Performance and It shows that Workfiles Created/Sec and Worktables created /sec are in CRITICAL status.


I guess the threshold is a configured value within SOLARWIND and my suspicion is that hasn't been specifically set for your environment. This "high" number of Workfiles may be normal depending on the activity, not necessarily a result of crap code either.
Cool
WhiteLotus
WhiteLotus
Old Hand
Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)

Group: General Forum Members
Points: 393 Visits: 882
Eirikur Eiriksson (8/25/2014)
WhiteLotus (8/19/2014)

Yes I use SOLARWIND to monitor SQL Performance and It shows that Workfiles Created/Sec and Worktables created /sec are in CRITICAL status.


I guess the threshold is a configured value within SOLARWIND and my suspicion is that hasn't been specifically set for your environment. This "high" number of Workfiles may be normal depending on the activity, not necessarily a result of crap code either.
Cool


Hmm I believe that it has been set in my environment ... cause when i check the fragmentation of indexes it is identical ....
Moreover It also show the high number of pagesplit and page write ... I hv configured the fill factor in some indexes that get fragmented quickly but it seems the number of pagesplit is still high ..from 12 am -5 am it is relatively slow ( around 20/sec) but it becomes so high at 7 pm - now (around 90/sec)

I wonder how to lower it down .... Any idea ?

Thankss
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47435 Visits: 44405
I will repeat what I said earlier

GilaMonster (8/25/2014)
This is one of the flaws at looking at just perfmon counters. Sure, work tables are 'high', but you haven't said if they're higher than normal or if they're causing problems (don't use the tools blindly).
Performance analysis is never about one counter. There's no one counter or value that tells you everything. It's about looking at the whole system, perfmon counters, wait stats, query execution statistics and drawing conclusions from all of them together.

The perfmon counters, with very few exceptions don't have good or bad thresholds. They have 'normal' and 'not normal' for your server. The wait stats tell you what, in general, SQL is spending time waiting for during query executions and the query stats tell you which are your most resource-intensive queries overall.


Page splits/sec are NOT just the mid-index splits which cause fragmentation. As for how to reduce both it and the page writes/sec, maybe ask the users not to use the system?

Yes, that was a silly suggestion, but it'll do what you want (reduce the counter values).

Stop looking at individual counter values with a desire to reduce them (you can reduce them by decreasing the workload, but that would be counterproductive). Look at the overall server health. Look for changes (high not, wasn't high last week), look for things which are causing problems and fix those.


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


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