On Sun, May 19, 2002 at 06:26:54AM -0700, Henry Hank wrote:
> 
> Hello All,
> 
>   I recently moved my database from mysql 3.22.29 to 3.23.41, and
> udated all my tables to MyISAM tables.  Under ISAM, I could take the
> filesize of the ISD table and divide by the record length to get the
> exact number of records returned by "select count(*)" from that
> table (or vise-versa - it always worked).

Ah, neat trick. :-)

> Now with the MyISAM tables, this does not seem to work - the files
> are always a little larger than the record count multiplied by the
> record length.  Since these are all fixed length tables, where is
> the extra space comming from? It's not much - about .1% or between
> .5 and 1.5 megabytes out of a 20 million record fixed-length table.
> I don't think it is a deleted record space, since (a) very few
> records are ever deleted, and new inserts happen every 3 seconds and
> (b) the overage amount is never divisable by the record length.

The extra space is probably coming from the fact that MyISAM files
have some special bits (or bytes, actually) that it uses to keep track
of things.  This "row header" is stored at the beginning of each row
in the file.  It probably wouldn't be hard to figure out the exact
size of the header, but there's at least one part of it (a special
bitmask) that depends on the number of columns in your tabe--the more
you have, the larger it is.

> Is there a forumula that will accurately calculate the size of
> MyISAM fixed-length files?  Is there a new overhead associated with
> myisam tables?

Probably, yeah.  I just don't know it (yet?).

Jeremy
-- 
Jeremy D. Zawodny     |  Perl, Web, MySQL, Linux Magazine, Yahoo!
<[EMAIL PROTECTED]>  |  http://jeremy.zawodny.com/

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to