facebook / mysql-5.6

Facebook's branch of the Oracle MySQL database. This includes MyRocks.
http://myrocks.io
Other
2.48k stars 714 forks source link

Determin secondary index value emptiness by datadic #1440

Open rockeet opened 6 months ago

rockeet commented 6 months ago

In most cases, secondary index values are empty, thus rocks_iter->value() is not needed in such cases.

We realized an SST with lazy load of value, this is a big improvement for large values.

When value is small(even empty), lazy load is less useful, but the calling chain is still needed, in our optimized rocksdb branch, in iter scan, it is about 70~90ns per kv-pair, in which the iter->value() is about 11ns for empty value.

If secondary index value emptiness can be identified by datadic, the iter->value() can be omitted, this is a reasonable optimization.