Hi, In every instance I've seen, MySQL always allocates the amount you set for key_buffer at server startup even if it never comes close to being *used*. (It shouldn't be doing malloc()s or whatever for that on the fly. :-)) Same thing for query_cache_size.
Now about join, read, and sort buffers, that's correct that they're only allocated when doing those specific operations. BUT, the thing I'm not clear on is whether the amount you have set is allocated all at once or as needed up to the specified size. Of course, if the whole size is needed, it would be faster to allocate it all at once. But if not..... Maybe I should ask on the Internals list sometime. Matt ----- Original Message ----- From: "Alexis Guia" Sent: Wednesday, November 05, 2003 5:30 AM Subject: RE: mysql memory usage Sorry, but I disagree :/ I always used 250MB of key buffer, and MySQL never allocates more than 50MB, in my database. Read buffer is only allocated when full scans are done. Join buffer is allocated when there are joins without index use. Sort buffer is allocated when needed, and etc... Alexis P.S.: you can test it easily, doing specific queries for each case. -----Original Message----- From: Jeremy Zawodny Sent: terça-feira, 4 de Novembro de 2003 23:51 To: Alexis Guia Cc: 'Benjamin KRIEF'; [EMAIL PROTECTED] Subject: Re: mysql memory usage On Tue, Nov 04, 2003 at 10:09:01AM -0000, Alexis Guia wrote: > > Hi, > > I think that MyISAM uses the key buffer only if needed. The same happens > with almost all the other buffers (read buffer, sort buffer, etc.). True, but there's a subtle difference between "uses" and "allocates." If you tell MySQL that it has 16GB for a key_buffer, it'll allocate 16GB even if it only ever uses 28KB. The same is true of several (probably all?) other buffers. Jeremy -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]