MySQL Forums
Forum List  »  Newbie

Re: How much space take each column in table
Posted by: Rick James
Date: September 14, 2010 10:55PM

Will this do?
SELECT AVG(LENGTH(blob_field)) + 2 FROM tbl;
(Of course, it will have to scan the whole table.)
The "+2" is for the length field for BLOB.

Avg_row_size minus the fixed width fields gives you avg width of all the VARCHARs, BLOBs, etc.

Oh, yes. I keep forgetting about this oddball:
http://dev.mysql.com/doc/refman/5.0/en/procedure-analyse.html

Options: ReplyQuote


Subject
Written By
Posted
Re: How much space take each column in table
September 14, 2010 10:55PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.