我要最优化地履行我的SQL问题。
SELECT * FROM (
(SELECT * FROM users USE INDEX(names) WHERE name LIKE %leo% ) UNION
(SELECT * FROM users USE INDEX(names) WHERE name LIKE %le% ) UNION
(SELECT * FROM users USE INDEX(names) WHERE name LIKE %eo% ) UNION
(SELECT * FROM users USE INDEX(names) WHERE name LIKE %l% ) UNION
(SELECT * FROM users USE INDEX(names) WHERE name LIKE %e% ) UNION
(SELECT * FROM users USE INDEX(names) WHERE name LIKE %o% )
) as A LIMIT 5 OFFSET 5;
我想像这样的价值观(le、 le、eo、 l)。