I'm trying to get some data with eager loading, which results in more queries than before.
Is there another way to tune down the number of queries as low as possible? As you can see i only need the posBrandKey (text) and id values.
$criteria = craft()->elements->getCriteria(ElementType::Category);
$criteria->status = null;
$criteria->limit = null;
$criteria->group = 'productBrand';
$criteria->with = array('posBrandKey');
$brands = array();
foreach ($criteria as $entry) {
$key = $entry->posBrandKey;
$brands[$key] = $entry->id;
}
My goal is to have the best performance possible, this is one of the many queries I call in the same script.