The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.

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

Martin
8.6k114149237
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.

-john.

permanent link

answered 02 Mar '11, 20:42

John%20Smirnios's gravatar image

John Smirnios
8.7k377106
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
1

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
1

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×238
×10

question asked: 02 Mar '11, 10:19

question was seen: 1,942 times

last updated: 02 Mar '11, 20:42