When is tempdb used?

  • I would like to know different scenarios under which tempdb is used. Some of them i know, would like to know if there are any.

    i) creating #tables

    ii) when doing joins( not sure about this)'

    Any more?

  • From - http://technet.microsoft.com/en-us/library/cc966545.aspx - which is a good read.

    Query

    Triggers

    Snapshot isolation and read committed snapshot (RCSI)

    MARS

    Online index creation

    Temporary tables, table variables, and table-valued functions

    DBCC CHECK

    LOB parameters

    Cursors

    Service Broker and event notification

    XML and LOB variable

    Query notifications

    Database mail

    Index creation

    User-defined functions

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • I'll also add one to the list, hash tables and work tables created as part of execution plans.

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

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply