Table vs Temp Table Performance

后端 未结 7 2006
梦如初夏
梦如初夏 2021-02-14 13:54

Which is faster for millions of records: Permanent Table or Temp Tables?

I have to use it only for 15 million records. After processing is complete, we delete t

7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-14 14:08

    In your situation we use a permanent table called a staging table. This is a common method with large imports. In fact we generally use two staging tables one with the raw data and one with the cleaned up data which makes researching issues with the feed easier (they are almost always a result of new and varied ways our clients find to send us junk data, but we have to be able to prove that). Plus you avoid issues like having to grow temp db or causing issues for other users who want to use temp db but have to wait while it grows for you, etc.

    You can also use SSIS and skip the staging table(s), but I find the ability to go back and research without having to reload a 50,000,000 table is very helpful.

提交回复
热议问题