1

I've created a custom product attribute of type text.

When viewing the catalog_product_entity_varchar table, I'm slowly but surely noticing these records being inserted into that table (if I save new products, edit & save existing products etc.).

My question is this:

Why has Magento not created NULL values for all products in my catalog for this attribute? I did choose to Used in Product Listing = Yes.

1
  • attribute of type text will appear in catalog_product_entity_text Commented Mar 20, 2014 at 7:14

1 Answer 1

2

When adding a new attribute (and attaching it to attribute sets) the products that already existed prior to adding it do not have values for that attribute.
It would be kind of useless and a performance killer (and magento does not need an other performance killer).
Here is a scenario.
Let's say you have 10k products in your store. And you add one new attribute for all the attribute sets.
If your expectation was right then you will have 10k new lines in a table that you don't need. Not to mention that it will take a while to insert them when you create the attribute.
If you later decide to use that attribute only for 3 products you remain with 9997 useless lines.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.