I found the solution in the query logs and it's surprisingly logical.
Short Answer
The product in question was a bundle product and for bundle products all attributes of the bundle selections are taken into account as well. This way you also find bundles that may contain a product with the specified options in layered navigation.
Long Answer
This query runs after the first round of indexing:
INSERT IGNORE INTO `catalog_product_index_eav_idx` SELECT `l`.`parent_id`, `i`.`attribute_id`, `i`.`store_id`, `i`.`value` FROM `catalog_product_relation` AS `l`
CROSS JOIN `core_store` AS `cs`
INNER JOIN `catalog_product_index_eav_idx` AS `i` ON l.child_id = i.entity_id AND cs.store_id = i.store_id GROUP BY `l`.`parent_id`,
`i`.`attribute_id`,
`i`.`store_id`,
`i`.`value`;
If I run the SELECT
subquery and limit it to the attribute and product from above, I get the following, which are exactly my mysterious values:
mysql> SELECT `l`.`parent_id`, `i`.`attribute_id`, `i`.`store_id`, `i`.`value` FROM `catalog_product_relation` AS `l`
-> CROSS JOIN `core_store` AS `cs`
-> INNER JOIN `catalog_product_index_eav_idx` AS `i` ON l.child_id = i.entity_id AND cs.store_id = i.store_id GROUP BY `l`.`parent_id`,
-> `i`.`attribute_id`,
-> `i`.`store_id`,
-> `i`.`value` having l.parent_id=10515 and i.attribute_id=274;
+-----------+--------------+----------+-------+
| parent_id | attribute_id | store_id | value |
+-----------+--------------+----------+-------+
| 10515 | 274 | 12 | 99437 |
| 10515 | 274 | 13 | 99437 |
| 10515 | 274 | 14 | 99437 |
| 10515 | 274 | 15 | 99437 |
| 10515 | 274 | 16 | 99437 |
| 10515 | 274 | 17 | 99437 |
| 10515 | 274 | 18 | 99437 |
| 10515 | 274 | 19 | 99437 |
| 10515 | 274 | 20 | 99437 |
| 10515 | 274 | 21 | 99437 |
| 10515 | 274 | 22 | 99437 |
+-----------+--------------+----------+-------+
11 rows in set (0.45 sec)
The code for this query is in Mage_Catalog_Model_Resource_Product_Indexer_Eav_Abstract::_prepareRelationIndex()
catalog_product_relation
contains the bundle relations, so the value comes from a bundle selection of product 10515.
Best Answer
All Attributes are store into "eav_attribute" table in magento.
IF you open this table , you can see field name attribute_code && attribute_id are there where attribute_id is primary key
Now this table is joined with other table depend on attribute type like select , int , varchar etc.
Means IF attribute input type is int, than it will join with catalog_product_entity_int table. catalog_product_index_eav used for product attribute indexing data store. IF you truncate this table & running indexer of magento, this table data will generate.