Comments on: MyRocks Engine: Things to Know Before You Start https://www.percona.com/blog/myrocks-engine-things-know-start/ Wed, 05 Jun 2019 18:42:27 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: George O. Lorch III https://www.percona.com/blog/myrocks-engine-things-know-start/#comment-10968947 Fri, 02 Feb 2018 17:10:13 +0000 https://www.percona.com/blog/?p=47132#comment-10968947 MyRocks, like most/all MySQL storage engines appends the PK (or columns needed to re-create the entire PK) to the secondary key. This is how the association of SK -> PK works. AUTO INC is a logical value assigned to a column when the column is inserted and does not change at any time without an explicit UPDATE on that column.

SKs should only get changed if you re updating a portion of the key itself or a portion of the PK that it refers back to. In most tree oriented storage engines this results in a deletion of the record in the effected SKs and a re-insertion of the record as the position of the record within the tree will have changed.

]]>
By: Andy https://www.percona.com/blog/myrocks-engine-things-know-start/#comment-10968944 Fri, 02 Feb 2018 07:33:41 +0000 https://www.percona.com/blog/?p=47132#comment-10968944 How does MyRocks handle secondary indexes?

Let’s say I use auto-increment as the primary key. My understanding is that in innoDB updates are in-place so each row has an auto-increment id that doesn’t change. Secondary indexes simply point to this auto-increment id.

In RocksDB updates are not in-place but result in new versions of the row. Do these different versions all share the same auto-increment id? If not does that mean each update would change the primary key of the newest version to a new auto-increment id? In that case would the secondary indexes need to be updated to point to the newest primary key? If I have 20 indexes that’s a lot of updates to be done for simply changing 1 row.

]]>