looking at my SQL statement it’s doing a few SELECT statements which are the same for my Users.
I have a “Project” page where users can Comment on the Project itself. On the same page, Projects also have Updates which are assigned to the Project and Users can Comment on Updates too.
This means that the SQL is looking up the ID of the User twice if they comment on both the Project and Update within the same find(); query. Is there any way to prevent this or doesn’t it really matter?
Thanks 🙂
Have a look at caching in CakePHP. You can cache queries that you know won’t change over the lifetime of the user’s interaction, for example the user ID.
http://book.cakephp.org/1.3/view/1376/Cache
http://book.cakephp.org/1.3/view/1193/Caching