May 31, 2002 at 9:56 am
1. Are temp tables held in memory or written to disk?
2. When is something pushed out or dropped out of memory?
The temp_db is where data is stored when it is being processed, right?
I know what the transaction log is used but I am not clear what work is done in the transaction log and when it is done in the temp db.
Thanks! -K
May 31, 2002 at 10:33 am
1) Temp tables are stored in tempDB but once stored in they fit in memory it will not need to use the reference in tempDB.
2) When they are not longer needed or memory is not available for another process and the memory in use has no current activity.
3) Not always, a straight select will generally never use tempdb. However it you have an ORDER BY, GROUP BY, etc. in your code it will use tempdb for storage during the process, this is why a view or join with an order by cannot have more than 8000kb of data in a row in it just like a real table.
4) Stores transactional history information. It serves as a temporary workspace for logged query commands (insert, delete, update, but BULK INSERT, TRUNCATE TABLE) which when will be committed when done as long as no errors occurr.
"Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply