SQL Clone
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
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2642 Visits: 970
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 Guru
SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)

Group: General Forum Members
Points: 212037 Visits: 46259
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
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2642 Visits: 970
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 Guru
SSC Guru (204K reputation)SSC Guru (204K reputation)SSC Guru (204K reputation)SSC Guru (204K reputation)SSC Guru (204K reputation)SSC Guru (204K reputation)SSC Guru (204K reputation)SSC Guru (204K reputation)

Group: General Forum Members
Points: 204120 Visits: 41949
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.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
WhiteLotus
WhiteLotus
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2642 Visits: 970
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 Guru
SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)

Group: General Forum Members
Points: 212037 Visits: 46259
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
SSC-Dedicated
SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)

Group: General Forum Members
Points: 38554 Visits: 19424
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
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2642 Visits: 970
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 Guru
SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)SSC Guru (212K reputation)

Group: General Forum Members
Points: 212037 Visits: 46259
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