Mysql????????????CPU??ú??
???????????? ???????[ 2014/11/21 11:35:00 ] ????????????? MySQL CPU
????MySQl??????CPU??ú??
????1. ????????
???????????????????????β??????????????????????????20??????mysql??CPU????????????????select???????????????
????2. ???????
????????????????????е???
??????????select
SELECT
`province_name`??
`city_name`
FROM `phoneno_section`
WHERE SUBSTRING(??? phoneno_section_len) = phoneno_section
LIMIT ?
????where?????SUBSTRING???????У????????LEFT??????
SELECT
`province_name`??
`city_name`
FROM `conf_phoneno_section`
WHERE LEFT(??? phoneno_section_len) = phoneno_section
LIMIT ?
???????????CPU?????????LEFT?????е????????????????????????select??????LEFT?????е?phoneno_section_len???????CPU???????
????3. MYSQL????????
????ü ????????
??????a?? ???: id(????id)??user(?????)??pass????????type?????? 0??1????
?????????? user + pass ???????????? ??user??????pass??????? ??type ???????
????ü ???????????
??????1??SELECT * FROM a WHERE user = 't' AND PASS = 'p'??????user+pass??????????
??????2??SQL: SELECT * FROM a WHERE user = 't' OR user= 'f' ?????????κ?????
??????3??SQL: SELECT * FROM a WHERE user = 't'??????user????
??????4??SQL: SELECT * FROM a WHERE pass = 'p' ?????????κ?????
??????5??SELECT * FROM a WHERE user = 't' OR user= 'f' ?????SELECT user??pass FROM a WHERE user = 't' OR user= 'f' ????
??????6??SELECT * FROM a WHERE length(user) = 3 ????????
??????7??user???? ??type???????????
?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ???????????????ζ??????????????????????????????????????????????????????????????? OR ??like '%%'????????????????????like 'aa%'??????????е??
??????????innodb????myisam??????????????????е?????????????????????λ?????????β??????????????????θ???????????????У????????????????Ч???
??????????е??????????????????????????????????????????????е?type???1????0?????????0.5?????????????????????????????????????????mysql???????????????????
??????????????????????????????б???????????????????????????????????????????????????????????????е??????????????????????????????????
?????????????????????????????????????????????????????и????????????????????????????????
????4. MySQl??????Ч????????
????ü WHERE?????????????в???????WHERE column!=...????MYSQL????????????
????ü WHERE???????????????????????磺WHERE DAY(column)=...????MYSQL???????????????????LEFT?????????????????????????????????LEFT??????????????????????????????LEFT?????????????????????д????
????ü ??JOIN?????У?????????????????????????MYSQL????????????????????????????????????????????????????????????????
????ü ???WHERE????????????????????????LIKE??REGEXP??MYSQL??????????????????????????????????2???????????????????????????????LIKE 'abc%'??MYSQL????????????????????LIKE '%abc'??MYSQL?????????????
????ü ??ORDER BY?????У?MYSQL?????????????????????????????????????2?????????????????????漰?????????????????????????????Щ????????ORDER BY???????????????á?
????ü ???????????????????????????????????????????????????к???Ч?????????????????????????????????Щ????“0/1”??“Y/N”???????б??????????????????
??????????????????????????????????????????????????????????????????WHERE??????ORDER BY ??Σ???????Σ????????????Ч???
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11