LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 12-02-2004, 03:53 AM   #1
benbroad
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?

B.
 
Old 12-02-2004, 04:58 AM   #2
Crashed_Again
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, 06:01 AM   #3
benbroad
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)
 
  


Reply



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 10:25 AM
need help with pi calculations! daven1 Programming 2 01-06-2005 07:21 PM
Date calculations in BASH script Crashman Programming 4 07-03-2004 10:15 AM
MySQL size limit Robert0380 Linux - General 2 09-05-2003 03:36 AM
EIGRP and IGRP metric calculations dai Linux - Networking 1 12-16-2002 02:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:34 PM.

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