PDA

View Full Version : MYSQL DB size



chill
May 16th, 2001, 16:26
hi guys.
on many fwp is written 3mb mysql or something else.
how can i calcutlate how big my db is ?
is there a formular or something else.
like bit ingt 3k
varchar 2k

thx
chill

Epgs
May 16th, 2001, 18:02
don't know but i think 3 megs is huge.

ashben
May 17th, 2001, 00:44
If you have shell access then this would work ..

myhost:~ # cd /usr/local/mysql/data/
myhost:/usr/local/mysql/data # du -k -s
92873.

There's the answer - 92Mb


More: http://www.mysql.com/doc/T/a/Table_size.html

chill
May 17th, 2001, 06:57
no....sorry
i dont have a shell.
and your link just shows how big a mysql table can be...

but i f i have 6 cells.
and around about 1000 rows....

is this just 3mb or something like this.
or is this about 12 mb......!?!?


thx
chill

ashben
May 17th, 2001, 08:22
Post your table structure .. 6 cells and 1000 rows doesn't make sense .. what data type and length they are actually defines the size.

lucifer
May 17th, 2001, 08:29
yeah

look at the mysql docs and they tell you how many bytes each cell will take up

ie int(1) [0-255] = 1 byte


work out your bytes used for each col. worst case senario so var-fields are at there max

text and glob fields can be huge so maybe limit them to a size in your scripts

multiply by num of rows

add some overhead for the structure 100k should be easily enough unless you have loads of tables

chill
May 17th, 2001, 08:49
thank you so far..... :D

this is my table at the moment...

CREATE TABLE files (
id int(10) unsigned NOT NULL auto_increment,
name varchar(100) NOT NULL,
file varchar(160) NOT NULL,
doin varchar(70) NOT NULL,
owner varchar(60) NOT NULL,
downloaded bigint(10) unsigned DEFAULT '0' NOT NULL,
PRIMARY KEY (id)
);

..what you think about...?
i've at the moment around 1000 entries....



thank you so far
chill

Woofcat
May 17th, 2001, 09:17
That would be under 500k worst case... Probably much less...

lucifer
May 17th, 2001, 09:46
int(10) =10
varchar(100) =101
varchar(160) =161
varchar(70) =71
varchar(60) =61
bigint(10) =10

total=314

x1000 = 300k + bit more for luck


also depends how fragmented the data gets - not a problem if your not deleting changing things much - not sure if MySQL compacts itself ;)

chill
May 17th, 2001, 13:27
thank you guys....

you've helped me alot



THXTHXTHX
chill

Woofcat
May 17th, 2001, 19:45
Lucifer - Actually int(10)=4 and bigint(10)=8...

lucifer
May 18th, 2001, 07:26
duh...