-
- tman_f

-
Total Posts: 85
Joined: 2008-02-12
|
When a product collection is requested, an instance of an object that eventually implements IteratorAggregate is returned. This object contains the method addAttributeToSelect(), which modifies the EAV object’s $_select variable.
It appears that when the collection object is instantiated, all products in the database are retrieved. Then, when the addAttributeToSelect() method is called, the collection retrieves the entire set again, but with additional attributes in the result set. Also, when a filter method is called, it appears that the entire collection is retrieved again.
So my question is, am I being deceived, or is the entire product result set being retrieved multiple times before the final set is used?
If this is the case, wouldnt it make sense to build the entire Zend_Db_Select object and apply all necessary filters before requesting the result set?
Please, correct me if I am wrong or overlooking something.
Thanks.
|