, . , , .
:
catalog_product_entity_*, * : decimal, int, varchar, text, datetime (backend_type).
, , , .
:
value_id - just an increment id for the table
entity_type_id - the entity type id for the product (always the same)
attribute_id - reference to the attribute
store_id - reference to the store view
entity_id - reference to the product
value - actual value
entity_id, attribute_id, store_id. , .
, .
store_id = 0 , , , .
(store_id >= 1), .
, store_id = 0 , store_id = 1.
< >
, , (, - , , Mage::app()):
$collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToFilter('name', 'some_name');
echo $collection->getSelect();
, some_name.
SQL-, , :
SELECT
`e`.*,
IF(at_name.value_id > 0, at_name.value, at_name_default.value) AS `name`
FROM
`catalog_product_entity` AS `e`
INNER JOIN
`catalog_product_entity_varchar` AS `at_name_default`
ON (`at_name_default`.`entity_id` = `e`.`entity_id`) AND
(`at_name_default`.`attribute_id` = '96') AND
`at_name_default`.`store_id` = 0
LEFT JOIN
`catalog_product_entity_varchar` AS `at_name`
ON (`at_name`.`entity_id` = `e`.`entity_id`) AND
(`at_name`.`attribute_id` = '96') AND
(`at_name`.`store_id` = 1)
WHERE
(IF(at_name.value_id > 0, at_name.value, at_name_default.value) = 'some_name')
?
name ( 96 ) (is_global= 0), Magento catalog_product_entity_varchar (, name), (id = 0). :
IF(at_name.value_id > 0, at_name.value, at_name_default.value)
, 1 , .
, , .
$collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToFilter('weight', '1');
echo $collection->getSelect();
sql :
SELECT
`e`.*,
`at_weight`.`value` AS `weight`
FROM
`catalog_product_entity` AS `e`
INNER JOIN
`catalog_product_entity_decimal` AS `at_weight`
ON (`at_weight`.`entity_id` = `e`.`entity_id`) AND
(`at_weight`.`attribute_id` = '101') AND
(`at_weight`.`store_id` = 0)
WHERE
(at_weight.value = '1')
, catalog_product_entity_decimal id = 0.
website, , , Magento - .
status .
" ".
Magneto ( ).
cron ( ) EAV . , ( store id = 0).
, . catalog_product_flat_{store_view_id_here}.
/ .
, , ( . , ).
, Use in product listing, .
/ System->Configuration->Catalog->Frontend->Use Flat Catalog Product ( Use Flat Catalog Category).
, . EAV.
, . , magento. .
, .