Yury,
Can we see the code and queries in question? It may be a better solution to
clean up the queries(and code), perhaps change multiple queries into one
query ...

Indexing the tables would undoubtedly help as well. If they already are
indexed, when is the last time they were re-indexed and cleaned up?(this
needs to be part of your maintenance plan, preferably automated)

Those suggestions notwithstanding, you could create a RAMDISK device, copy
the tables to it when starting the system within a startup script(after
mounting it of course : ) ), then start MySQL using the ramdisk location. I
have never heard of anyone trying this, but it is definitely worth
exploring, and is a very cool, if not mad, experiment. Try it on a very
small database first, to save the money on memory... in case it won't
work: ). This will be cool if you like late nights of mad experimentation
and hacking scripts.

Just make sure you have LOTS of memory if you try this with a db that big.
Enough for your .9G database to fit in, and MySQL with the OS. It is pretty
cheap right now, so now is the time: ) Also remember that it requires more
CPU overhead to manage extreme amounts of memory and this can actually slow
you down... at least it used to be that way with x86 architecture. Even Sun
OS had some performance issues, when addressing say, 2G of memory. (we had a
12 CPU Custom Sun Monster Box with that much 5 years ago. It didn't go much
faster than one with 1G of memory!) It has been a while since I have seen a
box with that much memory (5 years) so they may have overcome some of the
obstacles that existed back then. This will require some research to
determine.

thx,
neil

----- Original Message -----
From: "Yury V. Bukhman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 15, 2001 5:00 PM
Subject: how to put database into RAM?


> 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