MyRocks and index-only scans

You are viewing an old version of this article. View the current version here.

This article is about MyRocks and index-only scans on secondary indexes. It applies to MariaDB's MyRocks, Facebook's MyRocks, and other variants.

MyRocks indexes use "mem-comparable keys" (index records are compared with memcmp). For some datatypes, it is easily possible to convert between the column value and its mem-comparable form, while for others the conversion is one-way.

For example, in case-insensitive collations capital and regular letters are considered identical, i.e. 'c' ='C'. For some datatypes, MyRocks stores some extra data which allows it to restore the original value back. (For latin1_general_ci collation, for example, it will store one bit which says whether the original value was a small 'c' or a capital letter 'C'). This doesn't work for all datatypes, though.

In particular, index-only scans are not supported for

  • BIT(n) columns (this could be implemented but at the moment it is not supported)
  • SET(...) columns (same as above)
  • ENUM(...) columns (same as above)

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.