What are your indexes like on your table?

Jeremy Burns
Class Outfit

[email protected]
http://www.classoutfit.com

On 8 Oct 2010, at 16:08, victor piousbox 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

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