NYCPHP Meetup

NYPHP.org

[nycphp-talk] database performance

Michael Sims jellicle at gmail.com
Fri Oct 21 10:39:34 EDT 2005


On Thursday 20 October 2005 16:28, Glenn wrote:

> i was reading some of the posts about database performance,
> and have an idea to help speed up certain queries.

You are correct, using LIMIT will often be faster than the same query 
without LIMIT:

http://dev.mysql.com/doc/refman/5.0/en/limit-optimization.html

However, the problem of keeping the parent_table updated with how many 
child rows apply may kill those gains.  It depends whether the child data 
changes often or rarely.  If the child data changes ten times for every 
one time you SELECT it, you will lose more than you gain.  If the child 
data changes twice yearly and is SELECTED ten times per second, this 
denormalization will clearly benefit performance.

It's all in how the data is actually being used.


Michael Sims



More information about the talk mailing list