MySQLOnRocksDB/mysql-5.6
forked from facebook/mysql-5.6

Loading…
UPDATE may hang when it does a full table scan and updates PK values #100
I believe the issue is that each row is being updated over and over again (from id 1 to 101 to 201 to 301, etc.). In a previous database the solution was implemented in the SQL layer - if a key was being updated we did not allow that key to be used to find the rows to update - i.e. the optimizer was not allowed to select that path. Since MySQLonRocksDB can only access rows by their keys, maybe we need to have a flag that can indicate that a row has already been updated and as we come to each row to see if we should update it, skip those with the flag set.
Yes the cause is rows being updated over and over.
I don't think a flag would be needed - MyRocks is not the first MySQL storage engine to have this property. It just fails to inform the SQL layer that full table scan is actually scanning primary key.
I already have a patch, I'll commit it shortly.
|
|
spetrunia |
Issue #100: UPDATE may hang when it does a full table scan and update…
…
…s PK values Summary: Do set handler::key_used_on_scan in ha_rocksdb::open. This informs the SQL layer that MyRocks uses primary key when doing a full table scan. When the SQL layer knows this, it will buffer updates that change the value of the primary key. Note: after this patch, rocksdb.rocksdb test fails with this error: Can't find record in 't8'. This is Issue #99. Test Plan: Run MTR Reviewers: hermanlee4, maykov, jtolmer, yoshinorim Reviewed By: yoshinorim Differential Revision: https://reviews.facebook.net/D45519 |
3d1ae11
|
Example:
Now, this query will hang:
Looking at SHOW PROCESSLIST one can see that the query is actually processing lots of rows: