Adjusting MySQL memory settings is the key to improving your databases
performance. These settings are declared using directives in the my.ini
file. We cover the most important settings on this site. MySQL performs 2
different types of memory allocations, global (shared by all connections and
databases) or per-connection.
This is important to understand before you use large value. While 100MB might
not be much for a global setting, it's a huge value for a per-connection setting.
Here is the simplified math:
min_memory_needed = global_buffers + (thread_buffers * max_connections)
in reality it's more like:
Minimum MySQL memory = key_buffer + innodb_buffer_pool+ innodb_log_buffer +
innodb_additional_mem_pool + net_buffer + max_connections * (read_buffer +
join_buffer + sort_buffer + myisam_sort_buffer + thread_stack + tmp_table_size +
read_rnd_buffer)
I have found that initialy most default values of MySQL parameters are very
conservative for todays "GBs of RAM" servers.
Increasing these values will usually result in big performance gains.
Compared to Microsoft SQL Server, MySQL feels very "direct/raw". But most of the
default settings are very low. You will most definitely need to tweak
them.
Ref:
http://dev.mysql.com/books/hpmysql-excerpts/ch06.html
http://dev.mysql.com/doc/refman/4.1/en/memory-use.html