Storage requirements for MySQL TEXT column
I have a MySQL table called errormsg2 using MyISAM storage engine with about a dozen columns.
Two of those columns I estimate account for most of the space used for each row, and they are of datatype TEXT. They are backtrace and msg.
I'm trying to estimate the amount of storage required for each row, and I came upon the following contradiction:
show table status where name = 'errormsg2'; shows that (data_length + index_length) / rows is about 778 bytes per row.
select avg( bit_length( em.backtrace ) + bit_length( em.msg ) ) / 8 from errormsg2 em; shows an average of 899 bytes of text per row from just these two columns.
How is it possible that the table store more data than it uses? What am I missing?
I have a MySQL table called errormsg2 using MyISAM storage engine with about a dozen columns.
Two of those columns I estimate account for most of the space used for each row, and they are of datatype TEXT. They are backtrace and msg.
I'm trying to estimate the amount of storage required for each row, and I came upon the following contradiction:
show table status where name = 'errormsg2'; shows that (data_length + index_length) / rows is about 778 bytes per row.
select avg( bit_length( em.backtrace ) + bit_length( em.msg ) ) / 8 from errormsg2 em; shows an average of 899 bytes of text per row from just these two columns.
How is it possible that the table store more data than it uses? What am I missing?
No comments:
Post a Comment