Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL: How to keep entire myisam table in memory?

I have a lot of RAM (1 gb) on my server, and I have a table (100 mb) that I would like to increase the speed of. Is it possible to keep the entire table in memory (while keeping it MYISAM)? Would this make things faster (I already have the proper indexes).

Thanks

like image 633
eric Avatar asked Dec 03 '10 07:12

eric


People also ask

Where is the MyISAM table stored in the SQL database?

Each MyISAM table is stored on disk in two files. The files have names that begin with the table name and have an extension to indicate the file type. The data file has an . MYD ( MYData ) extension.

How do I cache a table in MySQL?

If you use InnoDB, MySQL will automatically cache the table for you, and create hash-indexes for often used parts of the index. I suggest you increase the amount of memory MySQL has at its disposal and it should take care of your problems all by itself. By default MySQL is setup to conserve space, not to run fast.

Can MySQL supports in memory stack table?

1, “How MySQL Uses Indexes”. MEMORY tables can have up to 64 indexes per table, 16 columns per index and a maximum key length of 3072 bytes.

Which one is better InnoDB or MyISAM?

In terms of data queries (SELECT), InnoDB is the clear winner, but when it comes to database writes (INSERT and UPDATE), MyISAM is somewhat faster. However, the lower speed of InnoDB is more than compensated for by its transaction protocol.


1 Answers

A better suggestion will be increase query cache size, let mysql do the internal optimization

more details - http://dev.mysql.com/doc/refman/5.5/en/query-cache.html

like image 74
ajreal Avatar answered Oct 27 '22 04:10

ajreal