I am using Magento collection. I have a question about a filter. If I execute following PHP code, when does SQL get executed?
$xxx_collection = Mage::getModel('modulename/xxx')->getCollection();
$xxx_collection->getSelect()->limit($limit, $offset);
$xxx_collection->addFieldToFilter('user', $customerData->getId())->addFieldToFilter('xxx_id', 0);
The last line(filter code) will execute SQL? What about the second (limit code) line? If I don't use third line(addFieldToFilter), then the second line will execute SQL?
I am asking this question because I don't want my Magento to execute SQL twice. it will make overhead.