Hi,

Another thing to try can be the myisampack table compressor,
since you say you need just read-only access to the tables.
If the tables get smaller, they could perhaps fit in the OS buffer cache.
MySQL does a memory-map of compressed tables,
which should be quite like having a ramdisk that might overflow to a disk swap
(without the need to copy the data).

The docs say a typical space saving from using myisampack is 40-50%,
and I've seen a table shrink from 1.6GB to 260MB (factor of 6)!

This is notwithstanding the other suggestions.
You should reconsider indices and yes, a ramdisk may also help.
Actually, the improvement from using a ramdisk (and investing in more RAM)
will be seen when your machine is I/O starved (= mostly waiting for disk).
The difference may be small if you already see an almost-100% CPU utilization,
unless you're using a backward disk interface (like IDE in PIO mode...).

Jan


"Yury V. Bukhman" wrote:
> 
> Hi!
> 
> Background:
> I have a moderately-sized (0.9G) database which serves as a backend to a
> search engine.  The search engine is kind of slow, because it has to run
> multiple database queries for each user request (don't ask me why).  In
> order to speed things up, I am thinking of copying the entire database
> into RAM.  The users do not update it, they only search, so if the
> server goes down, I can just copy the database from hard drive into RAM
> again on startup.
> 
> Question:
> what is the best way to put an entire database into RAM?  I thought of
> using HEAP tables, but they seem to have some limitations, e.g. not
> allowing text column type.  Is it possible to just copy an entire data
> directory into RAM?  Are there operating systems that allow this?  I
> currently run Linux, but could switch easily to another UNIX-like
> system.  Have anyone done something like this?
> 
> Any RTFMs or other pointers to literature will be appreciated.
> 
> Cheers!
> 
> Yury
> 
>   
>----------------------------------------------------------------------------------------------------
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to