|
Posted by J.O. Aho on 10/24/06 04:41
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
Navigation:
[Reply to this message]
|