On Mon, Feb 1, 2010 at 4:51 PM, Cui Shijun <rancp...@gmail.com> wrote:

> I'm also confused by the difference & relationship between "open
> table" and "open file descriptor" by the table cache.
>

"open table" is a MySQL concept. "Open file descriptor" is an OS concept. A
single table (MyISAM) consists of three files: the .frm (description), the
.MYD (data) and the .MYI (indices). Thus, a single open table can correspond
to multiple open files. Additionally, temp tables, sortfiles and whatnot
also consume file descriptors.


>  As far as I understand, when a thread ask the global cache for a table:
> * if the table is opened before and currently not used by other
> thread, the request thread will get this table
>

"and *there is a cache entry that* is currently not used*" - multiple
entries can exist for the same table.


> * if no table in table cache is available( currently used by other
> thread, or not opened before ), the request thread will open this
> table
>

The thread will get a new cache object that opens that table, yes.


>  Once open a table, mysql *might?( I'm not sure )* open a file
> descriptor corresponding to the data file of the table. In that case,
> when the number of  table opened simultaneously goes too big, mysql
> will use too much file descriptors and then hit the bug 48929.
>
>  Your experience( "I've had one occurrence where it grew to 26.000
> open tables" ) seems to show there must be something wrong with my
> understanding, Hmm...  :-(
>

I just skimmed over it, but the bug seem related specifically to InnoDB, and
to a highly specific file descriptor number being equal to some form of
hardcoded limit - maybe different OSes or linux distro's have different
values for said limit, or maybe it only occurs under specific conditions.



-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

Reply via email to