????????????????????????commen sence???????Щ???????????????飬?????????????????Щ?????????????Щ?????????????????????mysql?????????Щcommen sense?????????
????1??varchar(5)?????洢???????????????????????
?????????к????????????????????????????????????????????????????????????????varchar(200)??洢url????????????????????????????????п????????????????????????
????????????????????????е?????????洢5???????2.5???????????????????????????????е????????????汾??5.0?????????5.0????????????????5.0????????洢5??“??”????????????????????????????????????????????????飺
????CREATE TABLE `test` (
????`name` varchar(5) NOT NULL DEFAULT ''??
????`info` char(5) NOT NULL DEFAULT ''??
????PRIMARY KEY (`name`)
????) ENGINE=MyISAM DEFAULT CHARSET=utf8;
???????????varchar??5???е?5???????5??“??”????????5??????bytes??????????洢????????????????????????????“????”??????mysql?汾??5.6?????????charset??utf8??gbk????????
?????????汾?????????У????????????????????????????????в????????????????????
???????????????http://dev.mysql.com/doc/refman/4.1/en/char.html?????mysq4.1???????
????The CHAR and VARCHAR types are declared with a length that indicates the maximum number of characters you want to store. For example?? CHAR(30) can hold up to 30 characters. (Before MySQL 4.1?? the length is interpreted as number of bytes.)
??????????????汾????????????
????The CHAR and VARCHAR types are declared with a length that indicates the maximum number of characters you want to store. For example?? CHAR(30) can hold up to 30 characters.
???????????????????????mysql?汾С??4.1?????洢?????????????varchar(5)????5??bytes????5????????????2.5??????????????????2????????
????mysql?汾???????4.1?????varchar(5)?е?5?????????????????????“??”??????????????????????????????????“??????”
????2??mysql?е?limit????????????
???????????????????limit??limit num?????limit num1??num2?????????????????limit??ò?????????????????
????????????????£??????innodb????????limit??????10000????????????Σ?id??int????time??int????title??varchar????body??mediumtext??????С???170M????????????????棬??ò?????????????????????????time????????????????
????SET @@query_cache_type=ON;
????SET GLOBAL query_cache_size=0;
??????Query profiler????????????????????
????set profiling=1;
???????????????漸???????????
????a??SELECT id??TIME??title FROM cnblogs WHERE TIME>=1315646940 ORDER BY TIME ASC LIMIT 2000??10
????b??SELECT id??TIME??title FROM cnblogs WHERE TIME>=1315646940 ORDER BY TIME ASC LIMIT 10
????c?? SELECT id??TIME??title FROM cnblogs ORDER BY TIME ASC LIMIT 3000??10
??????????a??b??c??a??b??c??c??a??a?????????????£????????????棬????????ε?????????棬????????Query profiler?п?????????????н?????У??????????????????
????SHOW profiles;
???????????????????????????????????????????????????limit?????"limit begin??num"?????????"limit num"???????Ч????????????????????????????????????????????????????????????????????????????£????????????id????????????????Σ?????limit??????????????????ε?????????????′???????С??????limit num???????Ч??????