Computing.Net > Forums > Linux > MYSQL Plannin

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

MYSQL Plannin

Reply to Message Icon

Name: Jamie_McCoy
Date: July 6, 2005 at 16:03:50 Pacific
OS: XP Pro 5.1
CPU/Ram: Pentium 4 2.4Ghz
Comment:

in the process of planning a heavy mysql database

basically 50,000 + rows in the table, each with 20 fields, most will be 5-15 chars long

can you give me any advice or things to watch out for that may cause drastic server loads

roamhosting.net



Sponsored Link
Ads by Google

Response Number 1
Name: anonproxy
Date: July 6, 2005 at 18:32:24 Pacific
Reply:

That's not really heavy, so don't worry too much (you're not running LiveJournal or anything). Let's say each record is 300 bytes and you have 100,000 records (30 million bytes or ~29MB). The dataset can easily sit in memory. If you control the hardware, just have enough RAM (exact amount depends on your entire environment, just be generous).

The only real headache you may find is the choke point of making lots of connections/queries at once. Also be careful about locking rows for updates. You can use some tried and true optimizations:

1) Start with the application. Cache database results. Pool database connections. If possible, use fewer queries and/or simpler ones. Return as little information from the database as possible.

2) Mess with the database. There are many resources online and in print for configuring MySQL. There is almost no end of things you can do and many vary with version, so start with the simplest things. Change table types, values, shorten keys, etc. Then work on things like the query cache. For your needs, you can get enough information online. However should you want to more info, I recommend High Performance MySQL.


0

Response Number 2
Name: Jamie_McCoy
Date: July 7, 2005 at 15:55:49 Pacific
Reply:

you know when your set a varchar(limit)

say i wanted to make a Varchar which cotained only someones first name, so at Max it would contain 15 Chars

Well if for some reason i decided to set it as Varchar(255)... would their be any optimized different in setting it to (15) rather than (255)

Or doesnt it make any difference?

roamhosting.net


0

Response Number 3
Name: anonproxy
Date: July 7, 2005 at 16:11:56 Pacific
Reply:

MySQL has solid documentation with user comments (much like PHP). Your particular question is answered there. In fact, it's answered in two places. The description for char says it uses padding to fill to limit, which means it fills up the field space with junk. varchar fields have no padding.

Notice also on that page there is a table which clearly shows varchar(n) has lower storage requirements for the same limit when compared with char. So, varchar is the clear choice for you.


0

Response Number 4
Name: Jamie_McCoy
Date: July 8, 2005 at 12:52:59 Pacific
Reply:

Thanx a lot for the help, i shell take all that u have sed into account

:-)

Jamie McCoy


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: MYSQL Plannin

problem whith mysql on php www.computing.net/answers/linux/problem-whith-mysql-on-php/22805.html

Re-Install mysql database www.computing.net/answers/linux/reinstall-mysql-database/26370.html

Cant Install Apache, MYSQL, PHP on www.computing.net/answers/linux/cant-install-apache-mysql-php-on-/21446.html