4

The row_at represents "Version ID" & also its "auto_increment" of type for the entity.

That concludes that one record/entity can have multiple rows with the same value for entity_id and a different value for row_id.

row_id = identifier for the row. entity_id = actual entity.

The theory :

  1. Purpose of row id :-
  • 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.

Please refer - https://docs.magento.com/user-guide/cms/content-staging-scheduled-update.html

  1. Circumstances where row_id will change :-
  • When want to change a product name for a month. You can schedule that change using the content staging by specifying a different product name for the date range needed.
  • Behind the scenes, magento will utilize that "row_id" to store the scheduled change. If a customer visits the site during the time the product name was scheduled to be changed, magento will load the row_id corresponding to the how the product was scheduled to "look" at that point in time.

So, possibly "content-staging" feature is used in system, that is why it has different row id & entity_id.

Till now i have found/conclude this, but i need some more information on

In which situation the entity_id and row_id are different in "catalog_product_entity" table ?

Any one would like to add more details ?

Any comments/answers appreciated.

0

1 Answer 1

3

Yes, you got this right. As you use the content staging feature and create scheduled campaigns or scheduled updates, new 'versions' of the same product are created as new rows in the database. Basically, the same entity ID now occupies multiple rows, but with different row IDs.

The entity ID stays the same in order to identify the product entity itself, and the scheduled versions of that entity will receive an identifier of their own - the row_id: enter image description here

Now, whenever you see a product enrolled in the content staging scheduled update like this, the row that will be loaded is the row which will include the current timestamp between the created_in and updated_in timestamps (or at least will be > created_in if there is no ending date). Those timestamps will be also found in the staging_update table as row identifiers and will provide information about the scheduled update or the campaign: enter image description here

The row_id that you see in the catalog_product_entity table will be propagated in the the values tables in order to map the entity version with the value version: enter image description here

In conclusion, the row_id changes when a new scheduled update will be created for a given product entity ID.

2
  • 1
    That makes a lot of sense! Thanks for clarifying. Jun 16, 2021 at 10:25
  • you are most welcome :D
    – Diana
    Jun 16, 2021 at 10:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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