What storage type (BTREE, RTREE, HASH) is the best (and why) for “from” and “to” to get the fastest result from queries like this:
SELECT `title`, `from`, `to` FROM `table_name`
WHERE @year >= `from` AND @year <= `to`
@year is the parameter to be replaced with a number
and
all numbers (@year, from, to) are float.
PRIMARY KEY or UNIQUE and covering index will using BTREE will be best for this type of query.
or
For covering index you add columns used in where clauses first then columns used in group by the columns used in order by and then columns used in select.
HASH indexis best forEQUALsearch andBTREE indexis best forrange search.