List:General Discussion« Previous MessageNext Message »
From:Sergei Golubchik Date:January 16 2003 8:16pm
Subject:Re: Avg_row_length
View as plain text  
Hi!

On Jan 16, Stefan Hinz wrote:
> Keith,
> 
> thanks once again! Well, anyone here from the MySQL developer team? Or
> any other guru who can explain why 10 = 11?
> 
> Here's the problem once again:
> 
> mysql> DESCRIBE myrowisam;
> +-------+----------+------+-----+---------+-------+
> | Field | Type     | Null | Key | Default | Extra |
> +-------+----------+------+-----+---------+-------+
> | col   | char(10) | YES  | MUL | NULL    |       |
> +-------+----------+------+-----+---------+-------+
> mysql> SHOW TABLE STATUS LIKE 'myrowisam';
> +-----------+--------+------------+------+----------------+
> | Name      | Type   | Row_format | Rows | Avg_row_length |
> +-----------+--------+------------+------+----------------+
> | myrowisam | MyISAM | Fixed      |  109 |             11 |
> +-----------+--------+------------+------+----------------+
> 
> Regards,
> --
>   Stefan Hinz <hinz@stripped>
>   Gesch?ftsf?hrer / CEO iConnect GmbH <http://iConnect.de>
>   Heesestr. 6, 12169 Berlin (Germany)
>   Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

It's because of NULLs.
Extra byte is used to mark, if the column is NULL or not.

(in fact it's a bitmap, that is it would be one byte for up to 8
columns, then it'll be 2 bytes, etc.)

Regards,
Sergei

-- 
MySQL Development Team
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, http://www.mysql.com/
/_/  /_/\_, /___/\___\_\___/  Osnabrueck, Germany
       <___/
Thread
Avg_row_lengthStefan Hinz14 Jan
  • RE: Avg_row_lengthJennifer Goodie15 Jan
  • Re: Avg_row_lengthSteve Edberg15 Jan
  • Re: Avg_row_lengthDan Nelson15 Jan
  • Re: Avg_row_lengthStefan Hinz15 Jan
    • Re: Avg_row_lengthSteve Edberg15 Jan
    • Re: Avg_row_lengthKeith C. Ivey15 Jan
      • Re: Avg_row_lengthStefan Hinz16 Jan
        • Re: Avg_row_lengthKeith C. Ivey16 Jan
          • Re: Avg_row_lengthStefan Hinz16 Jan
            • Re: Avg_row_lengthSergei Golubchik16 Jan
            • Re: Avg_row_lengthZak Greant16 Jan
          • Re: Avg_row_lengthgerald_clark16 Jan
          • Re: Avg_row_lengthStefan Hinz16 Jan
            • Re: Avg_row_lengthSergei Golubchik17 Jan
            • Re: Avg_row_lengthRoger Baklund17 Jan
          • Re: Avg_row_lengthgerald_clark17 Jan
          • Re: Avg_row_lengthStefan Hinz17 Jan
  • Re: Avg_row_lengthStefan Hinz15 Jan
  • Re: Avg_row_lengthStefan Hinz15 Jan