开发者

mySQL query size

I used to use a query in mySQL that tells me how big my query is.

However, I don't remember that query and can't seem to find it now.

Does anyone kno开发者_开发百科w that syntax on top of their head?

Basically it allows me to know how much in size I saved from using a 11 bit integer vs 2 bit integer etc.

Thanks,

Tee


Here's an overview, also with all data types: http://dev.mysql.com/doc/refman/5.1/en/storage-requirements.html


You can use SHOW TABLE STATUS LIKE 'MY_TABLE' to return a bunch of information about the table. The Data_length column will contain the size of the data file used for that table. There is also an "average row length", Avg_row_length, that might be useful.

See here for details: http://dev.mysql.com/doc/refman/5.1/en/show-table-status.html.

As mentioned in my comment above though, the number after an int declaration, int(11), does not affect the size of the data structure that holds the integer. It only affects the display width of the column. Furthermore, you will only see its effect if you are using ZEROFILL.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜