<martin.westin.gc@gmail.com> wrote:
>
> Views, I haven't got my head into yet but it sounds like I probably
> should :)
Views can make a big difference. Well worth looking into.
Unfortunately, they require using query(). I thought I saw something
about being able to query views in 1.3. Or maybe that's just wishful
thinking. I admit that it's not clear to me how that could be fit into
Cake in an efficient manner.
> That is a lot of time for so few queries IMHO. Possibly one or a few
> are taking very long because they return many rows. Whenever I return
> more than 20 rows of anything I usually just want to count them or
> somehow pull stats from them.
There may also be candidates for caching in your data retrieval. Give
some thought to how often certain queries are made fro a particular
user. If the data will always be the same, cache it.
Also, have a look at the queries themselves. For MySQL, in the
terminal, run "EXPLAIN your_query" [1] to see whether or not your
indexes are being used. Note that simply creating a key does not
guarantee it'll be used. If your query includes a function, for
instance, your key may be ignored. [2] This is crucial to understand
if you're concerned about performance.
[1] http://dev.mysql.com/doc/refman/5.1/en/using-explain.html
[2] http://www.mysqlperformanceblog.com/2007/10/17/mysql-performance-eliminating-order-by-function/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment