Hi, there is no way around having all data in this one page and it would be 
just very convinient to get it as formatted "cake-array" (and it's actually 
not too much data as the flat view proofs, only the separation into that 
many queries makes it that slow). What do you mean exactly by a finderQuery?

Thanks,
Christian

On Tuesday, July 10, 2012 10:31:44 PM UTC+2, cricket wrote:
>
> I guess the first question is, do you really need to fetch all 750 
> rows at once? Second, do you need to have all of that associated data 
> (Color, Icon, etc.)? I can't think of why you would unless you're 
> creating a report (ie. CSV file) or generating a *really* long HTML 
> page. 
>
> If yo really must grab all that data with your Categories, you could 
> try using a finderQuery in the Category model for the $hasMany 
> association. 
>
> On Tue, Jul 10, 2012 at 3:03 PM, Christian <goo...@mein-schnuller.de> 
> wrote: 
> > Hi there, 
> > 
> > I have the following find query: 
> > 
> > 
> > 
> >> $categoryItems_all = $this->Category->find('all', array('contain' => 
> >> array('Productgroup' => array('Fee' => array('conditions' => 
> >> array('Fee.country_id' => $this->__getCountryId() 
> >> 
> >> ) 
> >> 
> >> ), 
> >> 
> >> 'Product' => array('Productoption' => array('Color', 
> >> 
> >> 'Material', 
> >> 
> >> 'Size', 
> >> 
> >> 'Icon', 
> >> 
> >> ), 
> >> 
> >> 'Vendor' 
> >> 
> >> ) 
> >> 
> >> ) 
> >>                                                                         
> ), 
> >>                                                     'conditions' => 
> >> array('Category.parent_id' => $id, 
> >> 
> >> 'Category.active' => '1', 
> >> 
> >> 'Category.display' => '1' 
> >> 
> >> ) 
> >>                                                     ) 
> >>                                        ); 
> > 
> > 
> > If I pack the same query in a flat SQL view, it has 750 rows (and takes 
> same 
> > milii seconds). My Problem with the containable in find query is, that 
> cake 
> > splits it up into ~10000!! queries which takes approximately 10 seconds 
> and 
> > the database is not yet half filled with all items. 
> > 
> > Is there any alternative to use the containable behaviour which returns 
> a 
> > similar result but with a better performance? As a workaround I'm 
> currently 
> > using the view, but flat data was not was I was looking for. The "joins" 
> > options doesn't work either, since the result just contains the data of 
> the 
> > model the find query was running on. 
> > 
> > Thanks, 
> > Christian 
> > 
> > -- 
> > Our newest site for the community: CakePHP Video Tutorials 
> > http://tv.cakephp.org 
> > Check out the new CakePHP Questions site http://ask.cakephp.org and 
> help 
> > others with their CakePHP related questions. 
> > 
> > 
> > To unsubscribe from this group, send email to 
> > cake-php+unsubscr...@googlegroups.com For more options, visit this 
> group at 
> > http://groups.google.com/group/cake-php 
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to