SQL server does not use tempdb

  • I have a DB with some tables more than 7 millions record. However any query ,even with join , from those table are slow and the they are using tempdb at all. The reason that I say tempdb is not used is because its size is about 8 MB and it is not changed. I had no restart to Server them my assumption is that tempdb is not restored from model. Can anyone help me to find why SQL is not using tempdb?

  • java56p 72136 (6/6/2016)


    I have a DB with some tables more than 7 millions record. However any query ,even with join , from those table are slow and the they are using tempdb at all. The reason that I say tempdb is not used is because its size is about 8 MB and it is not changed. I had no restart to Server them my assumption is that tempdb is not restored from model. Can anyone help me to find why SQL is not using tempdb?

    Why do you think that using TempDB would make your queries faster? The key will be how the queries are formed, whether the predicates are SARGable, and whether there are any indexes that they can take advantage of.

    --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.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • TempDB is used for temp tbles, table variables, sort and hash spills, spools, version store and a few other things. If your queries aren't using temp tables theyn thyey may well not use TempDB, and that's not a problem.

    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

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

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