LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   rough MySQL size calculations? (https://www.linuxquestions.org/questions/linux-software-2/rough-mysql-size-calculations-261639/)

benbroad 12-02-2004 03:53 AM

rough MySQL size calculations?
 
Im afraid this is my 2nd slightly off topic question in as many days!

Does anyone know of a way to roughly calculate the size of a database?

The database in question will have 1 table with three fields:

"tag" - varchar(7)
"av" - boolean
"pr" - decimal(6,2)

primary index on "tag"
index on av
28 million lines in the table

Any ideas?

B.

Crashed_Again 12-02-2004 04:58 AM

hmmm...well the default location for mysql databases is in /var/lib/mysql/your_database. Doing an ls -l on the database you want would give you the size of it. Is this what you are talking about?

benbroad 12-02-2004 06:01 AM

Ideally I wanted to worl out roughly how big that file would be before I created the database (so that I don't kill my server!)

My thought was that the varchar is 7bytes, the bool is 1 and the decimal is 3? Times that by 28M then divide by 1024 to get KB then 1024 again to get MB gives me about 293MB.... But that doesnt allow for indexes and compression??? (it also doesnt allow for the fact that I am just guessing at bytes sizes for the rows)


All times are GMT -5. The time now is 05:42 PM.