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

On Jan 16, Stefan Hinz wrote:
> Sergei,
> 
> >> any other guru who can explain why 10 = 11?
> 
> > It's because of NULLs.
> > Extra byte is used to mark, if the column is NULL or not.
> 
> Thanks alot for the explanation. Thanks to Gerald Clark, too, who told
> me the same.
> 
> > (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.)
> 
> If so, this table should have an average row length of 92, not 91,
> shouldn't it (9 cols * 10 bytes + 2 bytes)?

No, it shouldn't :)

All the columns are NOT NULL, so there's no need for a is_null-bitmap.
Extra byte is still necessary, as a 'row is deleted' marker.
 
> MySQL>DESCRIBE myrowisam;
> +-------+----------+------+-----+---------+-------+
> | Field | Type     | Null | Key | Default | Extra |
> +-------+----------+------+-----+---------+-------+
> | col1  | char(10) |      |     |         |       |
> | col2  | char(10) |      |     |         |       |
> | col3  | char(10) |      |     |         |       |
> | col4  | char(10) |      |     |         |       |
> | col5  | char(10) |      |     |         |       |
> | col6  | char(10) |      |     |         |       |
> | col7  | char(10) |      |     |         |       |
> | col8  | char(10) |      |     |         |       |
> | col9  | char(10) |      |     |         |       |
> +-------+----------+------+-----+---------+-------+
> MySQL>SHOW TABLE STATUS LIKE 'myrowisam';
> +-----------+--------+------------+------+----------------+
> | Name      | Type   | Row_format | Rows | Avg_row_length |
> +-----------+--------+------------+------+----------------+
> | myrowisam | MyISAM | Fixed      |    1 |             91 |
> +-----------+--------+------------+------+----------------+
> 
> 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

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