MySQL Forums
Forum List  »  MyISAM

Re: Calculate bytes stored per row for dynamic format
Posted by: Rick James
Date: July 04, 2012 09:28AM

Overhead per row: 1-2 bytes (2 if utf8, not because of charset, but because it could be longer than 255 bytes.)
BIGINT: 8 bytes
VARCHAR(150), if Ascii or latin1: 1-151 bytes
VARCHAR(150), if utf8: 2-452 bytes
NULL (if any columns are NULLable): 1 byte

100K rows -- at least 1MB (tiny); worst case: 46.3MB (medium sized). Even at 46MB, 1/3 of the tables discussed here are bigger than that.

INDEX size -- that's another formula; do you need that, too?

If you DELETE or UPDATE rows, the math gets more complex.

Why have a BIGINT? INT (4 bytes) is big enough for most uses.
INT UNSIGNED can hold values 0..4 billion.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Calculate bytes stored per row for dynamic format
1647
July 04, 2012 09:28AM


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.