3 ms·
What's the performance of a MySQL LIKE query on a similar sized table (with an index)?
by dave1010uk 12y ago
What's the performance of a MySQL LIKE query on a similar sized table (with an index)?
- gfv 12y agoIt'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.
- mappu 12y agoMySQL can search by prefix by using only a trailing wildcard (LIKE "string%"), and then it will use an index if one is available.