Comments (5)
The reason for this is as follows:
- rowids are mem-comparable forms of PK.
- mem-comparable forms of PK used to be fixed-length for MyRocks, but since "efficient varchar encoding" they are variable-length.
- However, MySQL assumes that rowids have fixed length. Currently rowids are zero-padded.
- When MyRocks attempt to do a PK lookup for rnd_pos(zero-padded-rowid), the record is not found and we have an error.
from mysql-5.6.
Possible solutions:
S1. Let the rowid be PK in KeyTupleFormat. KeyTupleFormat is fixed-length.
- We will have to provide
ha_rocksdb::cmp_ref()
function - (TODO: is it possible to provide the original (non-mem-comparable) form of PK columns in all cases where MyRocks needs to return a rowid?)
S2. Keep the rowid being mem-comparable form.
- We will have to know how much end-space bytes are padding, and ha_rocksdb::rnd_pos() should strip them off before doing the index lookup.
from mysql-5.6.
is it possible to provide the original (non-mem-comparable) form of PK columns in all cases where MyRocks needs to return a rowid?)
This doesn't work in all cases.
Consider a case where the PK column uses case-sensitive collation (so one can't restore the value from its mem-comparable form).
Then, suppose we're doing an index-only scan on a secondary index.
In this case, secondary index only gives mem-comparable form of PK columns. We can't restore the original values, and so we can return them in KeyTupleFormat
from mysql-5.6.
We will have to know how much end-space bytes are padding, and ha_rocksdb::rnd_pos() should strip them off before doing the index lookup.
This looks feasible. mem-comparable images of keys are traversed by skip_func
which has two possible values:
A. skip_max_length
B. skip_variable_length
skip_variable_length skips data in "varchar encoding". Varchar encoding means 9-byte groups, where the 9th byte varies between 0xFF (no padding bytes) to 0xF7 (all 8 bytes were padding bytes).
That is, if the next 9-byte group is padding it has all zeros, it is zero-padding, otherwise it is not.
If there is less than 9-byte data, it is zero-padding.
from mysql-5.6.
https://reviews.facebook.net/D45639
from mysql-5.6.
Related Issues (20)
- DROP TABLE may take long time to wait for Seek() by drop_index_thread HOT 1
- UPDATE may hang when it does a full table scan and updates PK values HOT 3
- Add kv_format_version into RDBSE_KEYDEF and data dictionary
- Include RocksDB utility tools into MySQL binary HOT 4
- rocksdb.rocksdb test asserts with message "Failed to get column family info from index id" HOT 8
- SIGSEGV on create table contention HOT 2
- Release Row Locks when necessary, Transaction API variant
- Add more information to SHOW ENGINE ROCKSDB TRANSACTION STATUS
- DML statements over reverse-ordered CFs are very slow after #86. HOT 5
- rocksdb.cardinality and other tests fail assert in rocksdb::port::PthreadCall HOT 23
- Range scan with equal predicates returns wrong results with bloom filter HOT 7
- Possible memory leak in RDBSE_KEYDEF::setup
- background space reclaim isn't working after DROP DATABASE HOT 1
- Enable specifying per column family options without a separate config file
- Add rocksdb-specific tests to parts suite
- Refine checkpoint logic in MyRocks
- Using SingleDelete() in MyRocks
- Reduce rocksdb_sys_vars suite to one test
- Automatically setup bootstrap for rocksdb tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mysql-5.6.