Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-02-2004, 04:53 AM   #1
LQ Newbie
Registered: Nov 2004
Posts: 28

Rep: Reputation: 15
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?

Old 12-02-2004, 05:58 AM   #2
Senior Member
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
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?
Old 12-02-2004, 07:01 AM   #3
LQ Newbie
Registered: Nov 2004
Posts: 28

Original Poster
Rep: Reputation: 15
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)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
threads for mathematical calculations? skywalker27182 Programming 3 02-13-2005 11:25 AM
need help with pi calculations! daven1 Programming 2 01-06-2005 08:21 PM
Date calculations in BASH script Crashman Programming 4 07-03-2004 11:15 AM
MySQL size limit Robert0380 Linux - General 2 09-05-2003 04:36 AM
EIGRP and IGRP metric calculations dai Linux - Networking 1 12-16-2002 03:59 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:34 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration