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
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php
