0

In my magento 2.3.0 My product catalog has 100k products. In this 10k Products are having different entity_id and row_id for same sku.

I have below questions.

  1. If I load product collection using id it should be entity_id or row_id?
  2. What could be the reason for sku having different entity_id and row_id?
  3. Is it mandatory to have same values for both entity_id and row_id? If yes, How can I make it same values?

Thanks & Regards Palani

2 Answers 2

1

row_id is the column that is used to link your product tables together. For instance catalog_product_entity and catalog_product_entity_varchar will be joined with row_id

It is an enterprise database enhancement meant to optimise your dababase and make it scalable to big catalog.

--> In other words, given your catalog is big, you do need this row_id and no it is not always the same as entity_id

In practice, your custom product query will often be complex because of this row_id. Just remember row_id is the joining one, entity_id is your product id as you see it in the backend. And if they happen to be the same, don't hold your luck on it.

1
0

I am just trying to answer this question

  1. entity_id because it same $_product->getId(); as $_product->getData()['entity_id'];

  2. row_id is used to facilitate the Time Dimension for entities that support it. By having this additional identifier, it allows an entity (product, category, sales rule, etc..) to be stored more than once in their respective MySQL table but expressing different values for the same entity. These altered versions of the same entity are created using Magento's "Content Staging" feature. For More: LINK

  3. Based on the second answer. BIG NO.

Happy Coding

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.