This article explains how to use HANDLER commands efficiently with MEMORY/HEAP tables.
If you want to scan a table for over different key values, not just search for exact key values, you should create your keys with 'USING BTREE':
CREATE TABLE t1 (a INT, b INT, KEY(a), KEY b USING BTREE (b)) engine=memory;
In the above table, a
is a HASH key that only supports exact matches (=) while b
is a BTREE key that you can use to scan the table in key order, starting from start or from a given key value.
The limitations for HANDLER READ with Memory|HEAP tables are:
See also the the limitations listed in HANDLER commands.
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/handler-for-memory-tables/