On 6/22/07, TheTorst <[EMAIL PROTECTED]> wrote: > > I've just built my first small application with Cake. This is a really > small application using the following tables: groups, users, items, > groups_users, and items_users. My problem is that Cake generates way > to many queries when its processing my code. The debugger shown in the > bottom of the page tells me "33 queries took 67 ms" when a relatively > simple page have been rendered.
Those numbers are somewhat deceptive as your application is running with a debug of 1 or greater (I'm assuming) so it doesn't cache anything. Most of those queries disappear and are cached when you run your app in production mode. > Is this normal? I thought developers wanted to avoid unnecessary > queries. Sadly, that's the tradeoff when you use CakePHP's magic database methods. > > What is the best way to minimize the number of queries for a Cake > project? > Like any project, the best way to minimize the number of queries...is to do as few calls to the database as possible. :) -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
