Pulling Just the Columns You Need from a Magento Collection
If you only need names or IDs from a collection, there is no need to loop through every model. Magento can return the values directly.
Examples
Only want a particular field?
print_r($collection->getColumnValues('name'));
The team at Magento have even given us some rudimentary filtering capabilities.
print_r($collection->getItemsByColumnValue('name','fieldname'));
To keep queries light, also limit the selected attributes on the collection itself with addAttributeToSelect or addFieldToSelect.
Want this done for you? Find out more about our Magento development service.