????????????lock tables?????????????????????????б???????????????sql????г??????Σ???????sql???????????????????????Σ????????????
?????????
????mysql> lock table t18 read;
????Query OK?? 0 rows affected (0.00 sec)
????mysql> select a.name??b.name from t18 a??t18 b where a.id=b.id;
????ERROR 1100 (HY000): Table 'a' was not locked with LOCK TABLES
??????????????????????????????????????????????£?
????##????????????
????mysql> unlock tables;
????Query OK?? 0 rows affected (0.00 sec)
????##????????????
????mysql> lock table t18 a read??t18 b read;
????Query OK?? 0 rows affected (0.00 sec)
????mysql> select a.name??b.name from t18 a??t18 b where a.id=b.id;
????+------+------+
????| name | name |
????+------+------+
????| fzy1 | fzy1 |
????| fzy2 | fzy2 |
????| fzy3 | fzy3 |
????| fzy4 | fzy4 |
????| fzy6 | fzy6 |
????| fzy6 | fzy6 |
????+------+------+
????6 rows in set (0.01 sec)
????3????μ????
????myisam????в?????(select)???????????漰?????б???????????и??2???(update??delete??insert)???????????漰????д???????????????????????????????????????????lock table?????myisam??????????????????????????????????????????????????????????????
???????????????????????????????
????mysql> lock tables t17 read local??t18 read local;
????Query OK?? 0 rows affected (0.00 sec)
????#??в???
????...
????mysql> unlock tables;
????Query OK?? 0 rows affected (0.00 sec)
??????1???????????lock tables?????local ??????????????myisam??????????????????£???????????????β??????????
??????2??????lock tables???????????????????????????????漰???????????mysql????????????????????????lock tables???????????????????Щ??????????δ???????????????????????£?myisam??????ζ??sql??????????????????????myisam????????????????
????4??????????
????myisam??????д????е???????????????????????????£?myisam???????????????????????
????myisam?洢???????????????concurrent_insert????????????????????????????????????0??1??2??
????????0????????????????
????????1??????myisam??????п??????????м???б???????У???myisam????????????????????????????????β?????????????mysql??????????
????????2???????myisam????????п?????????????β????????????
????5??myisam?????????
????myisam?洢??????????д???????????д????????е?????????????????????myisam?????????????????????????????д????mysql??????????
????????д?????????????????????????????????????????У?д???????д???????????????????????mysql???д??????????????????????????????????Щ??????????myisam??????????
??????1???????????????low-priority-updates???myisam?????????????????????????
??????2????????????set low_priority_updates=1??????????????????????????????
??????3????????insert ??update ??delete ????low_priority?????????????????????
????????С??
???????????????????????£??????????mysql??myisam???????????
????????myisam??????????????????
??????1????????(s)??????????????????(s)????????(x)????????????д??(x)??????????????????д????е??
??????2????????????£?myisqm???????????????У???????????????????????ж???????????????????????
??????3??myisam???????????????д??????????????????????????????????low_priority_updates??????????insert ??update ??delete ???????? low_prority??????????д???????á?
??????4??????????????????????д?????????е????????????2??????myisqm???????????????????????????????innodb????????????