List:General Discussion« Previous MessageNext Message »
From:Stefan Hinz Date:January 15 2003 12:03pm
Subject:Re: Avg_row_length
View as plain text  
Steve,

> I believe there is an extra byte for the 'null' flag; if you declare
> this column to be NOT NULL, I'll bet the avg length will be 10.

nice bet, but you lose <g>:

mysql> DESCRIBE mynotnullisam;
+-------+----------+------+-----+---------+-------+
| Field | Type     | Null | Key | Default | Extra |
+-------+----------+------+-----+---------+-------+
| col   | char(10) |      |     |         |       |
+-------+----------+------+-----+---------+-------+
1 row in set (0.16 sec)

mysql> SHOW TABLE STATUS LIKE 'mynotnullisam';
+---------------+--------+------------+------+----------------+---------
----+
| Name          | Type   | Row_format | Rows | Avg_row_length |
Data_length |
+---------------+--------+------------+------+----------------+---------
----+
| mynotnullisam | MyISAM | Fixed      |    3 |             11 |
33 |
+---------------+--------+------------+------+----------------+---------
----+

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

----- Original Message -----
From: "Steve Edberg" <sbedberg@stripped>
To: "Stefan Hinz" <hinz@stripped>; <mysql@stripped>
Sent: Wednesday, January 15, 2003 12:46 AM
Subject: Re: Avg_row_length


I believe there is an extra byte for the 'null' flag; if you declare
this column to be NOT NULL, I'll bet the avg length will be 10.

-steve

At 10:43 PM +0100 1/14/03, Stefan Hinz wrote:
>Dear gurus,
>
>here's my final stupid question for today. Why is the average row
length
>11 when it should be 10?
>
>mysql> DESCRIBE myrowisam;
>+-------+----------+------+-----+---------+-------+
>| Field | Type     | Null | Key | Default | Extra |
>+-------+----------+------+-----+---------+-------+
>| col   | char(10) | YES  |     | NULL    |       |
>+-------+----------+------+-----+---------+-------+
>
>mysql> SHOW TABLE STATUS LIKE 'myrow%';
>+-------------+--------+------------+------+----------------+
>| Name        | Type   | Row_format | Rows | Avg_row_length |
>+-------------+--------+------------+------+----------------+
>| myrowisam   | MyISAM | Fixed      |   68 |             11 | <---
>
>TIA,
>--
>   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
>
>


--
+-----------------------------------------------------------------------
-+
| Steve Edberg                                      sbedberg@stripped
|
| University of California, Davis                          (530)754-9127
|
| Programming/Database/SysAdmin               http://pgfsun.ucdavis.edu/
|
+-----------------------------------------------------------------------
-+
| SETI@Home: 1001 Work units on 23 oct 2002
|
| 3.152 years CPU time, 3.142 years SETI user... and STILL no aliens...
|
+-----------------------------------------------------------------------
-+

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