Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What's the performance of a MySQL LIKE query on a similar sized table (with an index)?


It's not really possible to compare LIKE to ZRANGEBYLEX. LIKE in a general case is an infix search in all text in a column, while ZRANGEBYLEX is a special case of search of all values within a given range. ZRANGEBYLEX uses a lexicographic comparison, so one can only search for strings with a prefix between certain values.


MySQL can search by prefix by using only a trailing wildcard (LIKE "string%"), and then it will use an index if one is available.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: