开发者

MySQL myisam table, temporary table and index

开发者 https://www.devze.com 2023-01-02 12:44 出处:网络
Would it be faster to add in开发者_Go百科dex for \"t.name\"? Does the index for \"t.name\" is preserved when the temporary table \"x\" is created?

Would it be faster to add in开发者_Go百科dex for "t.name"? Does the index for "t.name" is preserved when the temporary table "x" is created?

SELECT x.id 
FROM 
    (SELECT t.name FROM t WHERE id_group=1 LIMIT 2000) AS x
WHERE x.name LIKE 'a%' LIMIT 0,12


in general when you do simple like on query statement on some column, this column should be an index, except some other cases

in this case i presume x.name is ordinary varchar 255 so you definately should do it

0

精彩评论

暂无评论...
验证码 换一张
取 消