MySQL Forums
Forum List  »  Stored Procedures

Re: Get the memory utilized by the particular row in particular in table of mysql
Posted by: Rick James
Date: May 06, 2016 11:22PM

There is no way to find out the exact size of a particular row in SQL.

There are some guidelines...

Assuming you are using InnoDB...

INT takes 4 bytes.
VARCHAR or TEXT takes as many characters as you have at the moment, plus 1 or two bytes. Each character is 1-4 bytes, depending on the CHARACTER SET and the particular characters.
DATE is 3 bytes.
Etc, etc.

Add those up, then multiply by 2 or 3 to get _approximately_ how much space is needed for the record, including overhead for the record, the block, etc.

SHOW TABLE STATUS LIKE 'tablename' gives an _approximation_ of the average row length.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Get the memory utilized by the particular row in particular in table of mysql
468
May 06, 2016 11:22PM


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.