Web Hosting Talk







View Full Version : Should i optimize my database?


mystycs
03-04-2010, 12:15 PM
I am looking to run a site that has alot of traffic with 100,000+ users on, with immense database usage. Should i optimize this database often? And is there a way to make a cron for this? And is it important to do this?

agustan
03-05-2010, 09:16 AM
I'm not a Database Administrator, but I've heard that by optimizing the database, it will 'speed up' the db process.
About setting up a Cron job for it, please try read this Thread (http://forums.asmallorange.com/topic/12948-cron-job-to-optimize-database/).

Hostwaresupport
03-05-2010, 09:26 AM
Hi,

Yep, you should optimize your mysql server in order to get better performance. You will find number of online tutorial where you can find ways to optimize mysql. Either way, you can hire any system admin who can get this done in cheap prize.

dazmanultra
03-05-2010, 09:52 AM
What are the main queries that you're running on the database?

Two very quick ways to speed up a database:-

1) Set appropriate indexes. Look at your SELECT queries, and see what attributes you're mainly selecting from - i.e. look at the WHERE clause. E.g. If you see 'LastName' being the most common way to look up something, then 'LastName' should be an index.

2) If you're getting a lot of database locking, then use InnoDB for your tables. InnoDB has row-based locking which means that where there is an insert of an update, the entire table doesn't need to be locked.

energizedit
03-05-2010, 10:22 AM
It is very easy to write a shell script that can be called via cron nightly to optimize your dbs. First deteremine what the appropriate mysql command is, then put it in a shell script and test. Then schedule with cron.

qualityhostings
03-06-2010, 02:13 AM
I am looking to run a site that has alot of traffic with 100,000+ users on, with immense database usage. Should i optimize this database often? And is there a way to make a cron for this? And is it important to do this?

Hi
Some of the script that can handle large number of visitors/data items will have their own internal database optimization engine, so that there is no need to hire a system administrator to optimize it. From your description it is unclear the name of the script that you are using. If you are using custom developed script then ofcourse you should optimize your db often.


</>