Skip to content

Commit 2946fcb

Browse files
Sekiphpkiatngcolinmollenhour
authored
Optimize EAV collections (OpenMage#911)
* Optimize loading of EAV collections - remove filter of entity_type_id * Optimize EAV collections - entity * Update app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php Co-authored-by: Colin Mollenhour <colin@mollenhour.com> * Update app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com> Co-authored-by: Colin Mollenhour <colin@mollenhour.com>
1 parent 00748ce commit 2946fcb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,11 @@ protected function _prepareStaticFields()
160160
protected function _initSelect()
161161
{
162162
$this->getSelect()->from(['e' => $this->getEntity()->getEntityTable()]);
163-
if ($this->getEntity()->getTypeId()) {
163+
164+
if ($this->getEntity()->getEntityTable() === Mage_Eav_Model_Entity::DEFAULT_ENTITY_TABLE && $this->getEntity()->getTypeId()) {
164165
$this->addAttributeToFilter('entity_type_id', $this->getEntity()->getTypeId());
165166
}
167+
166168
return $this;
167169
}
168170

0 commit comments

Comments
 (0)