Just to clarify, when setting debug to 0 only the "DESCRIBE `your_table`" queries are cached - of course a read() does still read in every field.
If you want to reduce the fields included, look at using findById() or just find() rather than read(). On Nov 28, 5:44 am, WordPress Guru <[EMAIL PROTECTED]> wrote: > Thanks Chris > > I did not know to set Debug to 0 for production. Thats is great. Is > there any other checklist to do stuff before you go in production ? > > Also I think I found another solution for my problem . You can define > $hasMany =>fields with list of desired fileds and it would not affect > the actual model [I hope so :) ] > > On Nov 27, 2:41 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > > > On Nov 27, 2007 1:01 PM, WordPress Guru <[EMAIL PROTECTED]> wrote: > > > > In the view.thtml of parent entity, it generates code to display > > > related children. I do not wish to display all the fields of children, > > > so I have edited the view.thtml to accomadate that. However cake > > > generates the SQL every time using the models I have defined and when > > > I use DEBUG = 2 in core, I can see the dump , and this sql annoys me > > > becasue it gets all the fields from the dbase , no matter which ones I > > > am using. > > > > Is there a way to restrict the fields. Now I know that when you use > > > findAll, you can pass fields array, but that is only for listing the > > > parent entity . The children are read as part of internal calls to > > > Model->read(null,$id). > > > When you set $debug to 0 because you're going to be in production, it > > only reads in all the fields once and caches that list so it doesn't > > have to do it again. > > > Hope that helps you understand the problem a little better. > > > -- > > Chris Hartjes > > > My motto for 2007: "Just build it, damnit!" > > > @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 -~----------~----~----~----~------~----~------~--~---
