1

The values of customer entities stored in different tables based on the attribute type

ex:

customer_entity
customer_entity_datetime
customer_entity_decimal
customer_entity_int
customer_entity_text
customer_entity_varchar

can you explain the benefit/need to store the entity values like this?

1 Answer 1

3

This is the based on EAV structure. Any attribute is stored on the basis of attribute type so that they can add as much column as they want. And its easy to use any where, like search.

The main reason to use many table is to reduce the space of database. If we use single table then we have to maintain text type in DB and it will wastage of memory for small data. That's why they created different table according to data type.

Also You don't need to change the product table definition for each attribute that you create

7
  • I'd say, the main reason for EAV is flexibility: You don't need to change the product table definition for each attribute that you create. Aug 22, 2016 at 12:47
  • @fschmengler even we can store all the values of attribute in one table like customer_entity_values, why many tables based on attribute type? Aug 22, 2016 at 13:17
  • @manokarthickkarthick The "value" column must have a type and you don't want to store everything in binary format. Aug 22, 2016 at 13:18
  • @fschmengler if we store all as text in a single table , what are the drawbacks? Aug 22, 2016 at 13:21
  • only memory or anything else? Aug 22, 2016 at 13:22

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.