Search code examples
magentoentity-attribute-value

Does Magento store EAV data across table types?


suppose you have a product in Magento with an attribute of foo. The value of foo for one product is "1" while the value of foo for another product is "bar".

Does Magento store the "bar" value in catalog_product_entity_varchar and the bar value in catalog_product_entity_int? Or will foo always be implicitly stored in _varchar because it's expected that that value may have (in this case) mixed values?


Solution

  • Magento's EAV system uses extreme normalization.

    Attribute values are stored in separate tables divided by data type (datetime, decimal, int, text, varchar) and keyed on various entity id numbers.

    Where the attribute is stored is dependent on the backend definition. You find this information in the eav_attribute table in the backend_type column.