TempDB

  • Hi masters,

    I'm thinking in putting some staging tables on tempdb.

    This are empty tables that receive some data from a bulk insert and then i make same validations to this data and insert it on my real tables on my user databases.

    I have some question about tempdb, maybe you can help me.

    1) TempDB is all reconstructed every time the server (SQL Server) Starts, correct?

    2) If the answer to the first question, is yes, this means that the stating tables that i have created the last time on tempdb , now (that the server restarted) are lost and i have to create them again. Correct?

    Do you know if you lose perfomance when inserting (from a bulk_insert) data to a staging table on a tempdb Vs on a staging table in a user db?

    tks,

    Pedro

  • pedro.ribeiro (4/1/2009)


    1) TempDB is all reconstructed every time the server (SQL Server) Starts, correct?

    Correct

    2) If the answer to the first question, is yes, this means that the stating tables that i have created the last time on tempdb , now (that the server restarted) are lost and i have to create them again. Correct?

    Correct

    Do you know if you lose perfomance when inserting (from a bulk_insert) data to a staging table on a tempdb Vs on a staging table in a user db?

    Humm.. I am not so sure but may be it depends on your disk configuration? not sure though

  • this is supposing you have the files of tempdb on the same disc conditions as the user databases.

  • pedro.ribeiro (4/1/2009)


    Hi masters,

    I'm thinking in putting some staging tables on tempdb.

    This are empty tables that receive some data from a bulk insert and then i make same validations to this data and insert it on my real tables on my user databases.

    Don't. TempDB is for temp tables and other temporary objects. Either create a staging database and put your tables in there or put them in the same database as the final tables are in.

    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
  • I'm with Gail, don't put staging tables in there.

    Create another filegroup on a new disk, or a new database to hold staging data. Tempdb is for temp working space that SQL needs, not you.

Viewing 5 posts - 1 through 4 (of 4 total)

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