Well, it says so here:

http://dev.mysql.com/doc/refman/5.1/en/

Regards

max_tmp_tables

Option Sets Variable Yes, max_tmp_tables

Variable Name max_tmp_tables

Variable Scope Both

Dynamic Variable Yes

Value Set

Type numeric

Default 32

Range 1-4294967295

The maximum number of temporary tables a client can keep open at the same time. (This option does not yet do anything.)

]]>First of all..thanks!!

You are absolutely right about the maximum number of temp tables. I had looked that at up at some point in writng the formula but forgot to update it evidently. I really wish that max_tmp_tables would be implemented max so you could know exactly how much could be used by temporary tables.

I completely forgot about binlog cache. Thanks!

]]>Good post.

Still missing from the formula is the memory consumed by memory tables (number of memory tables * max_heap_table_size).

Also, there is no actual limit to the number of temporary tables. The comments for max_tmp_tables says:

…The maximum number of temporary tables a client can keep open at the same time. (This option does not yet do anything.) …

And last one I can think of is binlog_cache_size, which may be allocated per connection if using transactional engines, so this one goes inside the “max_connections * (…)” formula.

Regards,

Shlomi