Re: Immediately write me!! Row size in mysql

From: Date: Sun, 04 Feb 2001 04:31:12 +0000
Subject: Re: Immediately write me!! Row size in mysql
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38071@lists.php.net to get a copy of this message
> Write me immediately how I find a row size in mysql table if i create a > table in this manner > create table size(f1 int,f2 date ,f3 varchar(25),f4 varchar(100), f5 text , > f6 int, f7 tinyint(1), f8 tinyint(1) ,f9 tinyint(3), f10 varchar(25)) You read the MySQL manual and add up the numbers?... http://mysql.org At a guess, I'd say it's: f1 int 4 f2 date 4 f3 25 f4 100 f5 4 f6 4 f7 1 f9 3 f10 25 ===== total 170, if I added correctly. Of course, that f5 field with text means that any given record could incur a *much* larger size in the database. Given that, and the size of the records, if I'm off by 4 or even 8 bytes, it shouldn't make that much difference. There's always some overhead anyway, so be generous in your planned disk space. PostgreSQL will show you this stuff (not the total, I don't think) if you do \d xxx in the psql monitor, and MySQL commands such as mysqlshow or mysqladmin might also. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#38071) next »