Correctly using eager loading in Plugin development
Eager loading only works when your field is a RelationField it does not work with Text fields. If you goal is to reduce the length of the queries and to maximize your performance you could fetch the raw rows instead of populating the elements.

$criteria = craft()-&gt;elements-&gt;getCriteria(ElementType::Category);
$criteria-&gt;status = null;
$criteria-&gt;limit = null;
$criteria-&gt;group = 'productBrand';

// create a query
$query = craft()-&gt;elements-&gt;buildElementsQuery($criteria);
// select only the rows you want/need
$query-&gt;select('elements.id as id, content.field_posBrandKey as posBrandKey');
$brands = [];
// execute it
$rows = $query-&gt;queryAll();

foreach($rows as $row){
    $brands[$row['posBrandKey']] = $row['id'];
}