Results 1 to 4 of 4

Thread: Work Files

  1. #1
    Join Date
    Jul 2003
    Location
    England
    Posts
    152

    Unanswered: Work Files

    Can't find an answer on the internet, or in documentation, so hopefully someone out there knows the answer.

    Why does SQL Server create workfiles as opposed to worktables? When does it decide to use one and not the other.

    Also, is there a variable which determines the destination of these workfiles?

    Thanks in advance ...
    Regards
    Dbabren

  2. #2
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    Your query is not clear, what do you mean by workfiles?
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  3. #3
    Join Date
    Jul 2003
    Location
    England
    Posts
    152
    Satya

    I am assuming (based on Ingres and Oracle experience) that these workfiles were what SQL Server used for sorting and aggregate functions when they became too big to fit in physical memory.

    The reason I pose the question is because I am evaluating a monitoring tool, which has worktables and workfiles in the same performance graph (assume they are related then?). I am happy that worktables are temp sort areas in tempdb, but do not know what these workfiles are? - which brings me back to my initial assumption.

    I cannot find any ref to them in BOL but I have found them mentioned in MS Support Site - but no real detail.

    Does this clarify my question?
    Regards
    Dbabren

  4. #4
    Join Date
    Jul 2003
    Location
    England
    Posts
    152
    To close the subject, I have finally found an answer.

    Tempdb is a general store for a lot of different types of data, e.g.
    spools, cursor worktables, sort worktables, hash tables (workfiles), create index w/sort_in_tempdb, etc.

    Workfiles are used for temp record storage during hash operations. They are created in memory but can overflow or spill to disk (to tempdb, not to separate OS-level files).
    Regards
    Dbabren

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •