Re: Advice about optomizing MYSQL
- From: "J.O. Aho" <user@xxxxxxxxxxx>
- Date: Tue, 24 Oct 2006 06:41:10 +0200
IchBin wrote:
J.O. Aho wrote:ZeldorBlat wrote:maxdamage wrote:Well, I was wondering if it would be better to do a series of smaller
queries (about 5 - 10) and use less overhead on the PHP end or do one
big querry that would fill a huge array (maybe 50x10) and use a ton of
overhead.
One big query. Trips to the database are generally expensive and a 50
x 10 array isn't very big at all. If all else fails, try the two and
see which performs better.
Keep in mind the distance to the mysql server from the machine running the php script. The further away the more risk for lag.
Figured I would touch on this. Is there any question about the performance of queries or this just the php end? If so how about normalizing the database? Every little bit would help.
Selecting the right normalization is of course important, just having one table or split everything in as small tables (column vise) are bad options, you need to find what will be most common asked data and try to have as few joins as possible to get the data out from the database.
There are quite many books written in this subject, a search on google gave those while web pages about it may come further down on the list.
One way that you can do is to normalize it as much as possible, then look at data that you need often and un-normalize until you got tables with data that you retrieve together and you should get an okey working database structure.
Another method that some recommend is to normalize 2-3 times and then halt.
I guess there are quite many different schools here, it's a question what feels easiest for you.
//Aho
.
- Follow-Ups:
- Re: Advice about optimizing MYSQL
- From: maxdamage
- Re: Advice about optimizing MYSQL
- References:
- Advice about optomizing MYSQL
- From: maxdamage
- Re: Advice about optomizing MYSQL
- From: ZeldorBlat
- Re: Advice about optomizing MYSQL
- From: J.O. Aho
- Re: Advice about optomizing MYSQL
- From: IchBin
- Advice about optomizing MYSQL
- Prev by Date: Proper form for sending mail
- Next by Date: Re: Screen shots
- Previous by thread: Re: Advice about optomizing MYSQL
- Next by thread: Re: Advice about optimizing MYSQL
- Index(es):
Relevant Pages
|