ASP Is Fun

Learning ASP
Free Course
Basics
Functions
SQL Commands
Sample Code

Servers / Setup
Host Reviews
Server Setup
Error Tips

Contract ASP
Development

Intro to ASP



 
French Wedding


MySQL Optimizing Tips



If you are working with a MySQL database, it is important to optimize the database so it runs as quickly as possible. Here are some tips to help out with this task.

Disk Drive Pretty much every MySQL query involves doing disk drive searches, i.e. roaming the disk drive looking at data. If your disk drive is busy doing other things - writing log files, handling other applications - this is going to be slow and involve a lot of jumping around. If you get a fast hard drive just for the MySQL data, then that hard drive's head can be very efficient at getting that data for you.

Queries Naturally, if you write awful queries, they will take eons to run. Don't do a select against a giant table on a field that has no index. Definitely don't do "like" queries against large text fields! Tune your queries so that each one is as efficient as possible.

Server Memory Settings There are a lot of settings in the my.ini file that you can edit. If you are running a relatively large database, here are four to look at:

table_cache=1250
key_buffer_size=64M
sort_buffer_size=4M
read_buffer_size=1M

The values there are ones I've used, but you can tune them based on the memory your system has. The table cache is the actual # of tables that can be open, while the other numbers are meg of memory available.

If you're running InnoDB for solid transactions - which I recommend - here are some settings to set -

innodb_buffer_pool_size=300M
innodb_log_file_size=100M
Basics of SQL Commands


ASP Main Page | ASP Ebooks | Free ASP Course | Contact Lisa
All content copyright © 2008 Minerva WebWorks LLC. All rights reserved.



Free Newsletter!

Ebooks
Intro to ASP
ASP SQL DB
Members
Shopping


Introduction to ASP

Romance Tips
Irish Romance
Italian Romance
French Romance

ASP Poll
How do you handle 500 errors?
I don't
Page does nothing
Displays error
Emails error