Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

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.

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?

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.

![]() |
![]() |
![]() |

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