June 10, 2011 at 9:51 pm
Hi All,
I have desgined a sproc which is called from a website , this sproc have lots of temp tables which get created calculated etc. I wanted to know:
1) If more than 20,000 users access this website which in turn call this sproc will the temp table create any perf problem? How these temp table is managed in a multi user environment ?
2) Table vaiable will be the right choice?
3) Do I have to use physical table to replace all the above two options?
Please share your recomendation.
Cheers,
Got an idea..share it !!
DBA_Vishal
June 10, 2011 at 10:08 pm
vkundar (6/10/2011)
Hi All,I have desgined a sproc which is called from a website , this sproc have lots of temp tables which get created calculated etc. I wanted to know:
Hmmm... please don't take this wrong but if it has "lots of temp tables", there may be a bit of a design problem and you may want to reconsider both the design of the tables and this proc that uses them. Of course, "It Depends" a whole lot on what the proc is actually doing.
1) If more than 20,000 users access this website which in turn call this sproc will the temp table create any perf problem? How these temp table is managed in a multi user environment ?
Again, "It Depends". SQL Server will certainly keep the Temp Tables in good order but if you have a couple of large ones or many small ones, you're going to need to make sure that every TempDB optimization and memory optimization has been made in order for 20,000 simultaneous users to perceive good performance. You should also have a hefty server (maybe even a federation of servers) to handle that many simultanous users. You'll also need lot's of memory whether you use Temp Tables or Table Variables because they both start out in memory and spill onto physical TempDB disk space when they no longer fit in memory. Please see what I consider to be the definitive article on that subject and others at the following URL: http://www.sqlservercentral.com/articles/Temporary+Tables/66720/
2) Table vaiable will be the right choice?
Again, "It Depends". There are many factors affecting the choice to be made between Temp Tables and Table variables. See the article at the link I provided above for more information on that subject.
3) Do I have to use physical table to replace all the above two options?
Gosh... that's probably as bad an idea as using a global temp table but, depending on what you're doing, I have to again say "It Depends".
--Jeff Moden
Change is inevitable... Change for the better is not.
June 11, 2011 at 1:16 am
Jeff Moden (6/10/2011)
Please see what I consider to be the definitive article on that subject and others at the following URL: http://www.sqlservercentral.com/articles/Temporary+Tables/66720/
:blush:
Thanks Jeff!
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 11, 2011 at 9:28 am
WayneS (6/11/2011)
Jeff Moden (6/10/2011)
Please see what I consider to be the definitive article on that subject and others at the following URL: http://www.sqlservercentral.com/articles/Temporary+Tables/66720/:blush:
Thanks Jeff!
Well it IS! I don't know of any other article on the subject of Temp Tables vs Table Variables that covers so much in such a readable manner in a single place. I love that article! 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
June 11, 2011 at 9:56 am
Other things have been covered but be sure to have tempdb on its own disk so it doesn't fight for IO versus other databases.
There aren't any definitive answer foreveryone but creating 1/2 to 1 tempdb file per core seems the proper configuration.
-------------------------------------------------
Will C,
MCITP 2008 Database Admin, Developer
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply