![](https://secure.gravatar.com/avatar/39b623a1559cf9c69ac3d9d4fb44e7fe.jpg?s=120&d=mm&r=g)
24 Oct
2013
24 Oct
'13
10:59 a.m.
Hi, Roberto! On Oct 23, Roberto Spadim wrote:
Hi guys, how could i optimize a hash index using like?
i was thinking about something like a index over first left bytes using hash, example: field LIKE "abc%"
create index hash_index( field(3) ) using hash
any idea if this could be possible? this could boost some queries here that i'm using btree
today i'm using the LIKE, but i'm considering a virtual column + a index over virtual column + a ( AND virtual_column='abc')
With the virtual column it'll work, but if you simply create an index like above and will use LIKE 'abc%', then it probably won't use the index. And don't forget that not all storage engines support HASH indexes. Basically, in 5.5 only MEMORY tables do. Regards, Sergei