The forum will be down for scheduled maintenance on Saturday, March 4 beginning at 10am EST. Actual downtime is unknown but may be several hours.

I am intrigued to use the Dataram Ramdisk for temp files of the database for speed up. Does anyone is using this or a smilar product in a productive environment? Is it save to do so?

asked 02 Mar '11, 10:19

Martin's gravatar image

accept rate: 14%

The server should really only be writing to the temp file when it absolutely must do so because the cache is full. You're probably better off taking the memory you would reserve for your RAM disk and just add it to your cache size.

You also run the risk of running out of space on your RAM disk if the server decides to write, for example, a very large intermediate result set. If you run out of space, the server will either abort the query or report a fatal error.


permanent link

answered 02 Mar '11, 20:42

John%20Smirnios's gravatar image

John Smirnios
accept rate: 40%

That is interesting, I thought, that all temporary tables will go into the tempfile independently of the cache size?

(03 Mar '11, 07:39) Martin

Temporary tables are much like base table pages in cache. If dirty, they will only get written out if they are forced out by demand for other pages that are not in cache. In fact, non-temp pages are more likely to get written out than temp pages because the background idle IO starts writing out non-temp pages in anticipation of an upcoming checkpoint. Temporary pages do not need to be written out at checkpoint time. If a temp table is created, used, then later dropped and no other query needed the memory, nothing will ever be written to disk for that temp table.

(03 Mar '11, 19:59) John Smirnios

I should also add that if the cache space occupied by the temp table is needed by another query, only enough pages to satisfy demand will be written out to the temp file. It is not the case that would would write then entire table to disk just because a query needed a little bit more memory.

(03 Mar '11, 20:02) John Smirnios
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 02 Mar '11, 10:19

question was seen: 1,969 times

last updated: 02 Mar '11, 20:42