If you are using MySQL, you can look at the explain plan and see where
you can add indexes to help.

http://dev.mysql.com/doc/refman/5.0/en/explain.html

Joe

On Oct 8, 11:08 am, victor piousbox <[email protected]> wrote:
> I have a website with a bunch of articles. This is one of the queries
> executed by I assume the Paginator:
>
> SELECT COUNT(*) AS `count` FROM `articles` AS `Article` LEFT JOIN
> `authors` AS `Author` ON (`Article`.`author_id` = `Author`.`id`) LEFT
> JOIN `websites` AS `Website` ON (`Article`.`website_id` =
> `Website`.`id`) LEFT JOIN `articles` AS `ParentArticle` ON
> (`Article`.`article_id` = `ParentArticle`.`id`) LEFT JOIN `articles`
> AS `ChildArticle` ON (`ChildArticle`.`article_id` = `Article`.`id`)
> WHERE 1 = 1
>
> It takes 2ms when I just go to /articles/index, but if I edit and save
> an article, the same query takes 123000ms (that's two minutes). I have
> 3300 articles.
>
> Why does this happen? And how can I avoid it?
>
> _V

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to