MySQLµ÷ÓÅ£±àÒëƪ
°²×°Ê±µÄÓÅ»¯
(ÒÔϲâÊÔÊý¾Ý¶¼À´×ÔÓÚmysqlµÄ¹Ù·½ÍøÕ¾)
²»ÒªÓÃrpm»òÆäËû¶þ½øÖÆ·½Ê½°²×°
ÒªÓÃÔ´´úÂë×Ô¼º±àÒë
Èç¹ûÊDZ¼ÌÚϵͳ£¬ÍƼöÓÃpgcc±àÒëÆ÷
ÇÒʹÓÃ-O6µÄ±àÒë²ÎÊý
ÕâÑù±à³öÀ´µÄmysql±ÈÓÃgcc2.95µÄÒª¿ì1%
½öÓÃÓõÃ×ŵÄ×Ö·û¼¯±àÒëMySql
mysqlÄ¿Ç°Ö§³Ö¶à´ï34ÖÖ²»Í¬µÄ×Ö·û¼¯(mysql4.1.11)
µ«ÎÒÃdz£ÓõÄÒ²Î޷ǾÍÊÇlatin1¡¢gbk¡¢utf8ÕâÈýÖÖ¶øÒÑ
ËùÒÔÒ»°ãÓñàÒë²ÎÊý
–with-charset=latin1 –with-extra-charsets=gbk,utf8
¾ÍÐÐ
Óþ²Ì¬·½Ê½±àÒëmysqld
ÓñàÒë²ÎÊý
–with-mysqld-ldflags=-all-static
ÔÚlinuxϽ«»áÌá¸ß13%µÄËÙ¶È
±àÒëʱ²»ÒªÓòÎÊý–with-debug»òÕßÊÇ–with-debug=all
–with-debug=allÖÂʹ¼¸ºõËùÓеIJéѯÂý20%£¬ÓеĸüÉõ
½öÊÇ–with-debugÒ²»á´øÀ´15%µÄ²éѯËÙ¶ÈϽµ
Èç¹û±àÒëµÄʱºò¼ÓÁË–with-debug=all²ÎÊý
ÄÇô¿ÉÒÔÓÖskip-safemallocÀ´Æô¶¯·þÎñÆ÷
ÕâÑùËÙ¶ÈÓ°Ïì¸ú–with-debug²î²»¶à
ÔÚÅÜÔÚx86ÉϵÄlinuxÏÂÓÃgcc²»ÓÃframe pointers±àÒë
Ò²¾ÍÊÇÓòÎÊý-fomit-frame-pointer
»òÕßÊÇ-fomit-frame-pointer -ffixed-ebp
ÕâÑù»áʹmysqld¿ì1-4%
ÓÃÃüÁîstrip mysqld stripÒ»ÏÂmysqldµÄ¶þ½øÖÆÎļþ½«»áÌá¸ß4%µÄËÙ¶È
ÓÃunix socketÀ´Á¬±¾»úµÄmysql·þÎñÆ÷±ÈÓÃtcp/ipÒª¿ì7.5%
(unixÏ£¬Á¬Ö÷»úÃûlocalhostȱʡÓõÄÊÇunix socket)
ËùÒÔ½ö´Ó±¾»úÀ´Á¬µÄmysql·þÎñÆ÷
¿ÉÒÔÓòÎÊý–skip-networkingÀ´Æô¶¯(½«²»¼àÌý3306¶Ë¿Ú)
ÓÃtcp/ipÀ´Á¬Ô¶³ÌµÄmysql·þÎñÆ÷±ÈÁ¬±¾µØµÄmysql·þÎñÆ÷ÒªÂý8-11%
É÷ÖØʹÓÃsecure connection(ËùÓÐÊý¾Ý¶¼»á±»sslÖ§³Ö¼ÓÃÜ)
ÒòΪÕâÑù»á±È²»¼ÓÃÜÂý55%
Êý¾Ý¿âÉè¼ÆʱµÄÓÅ»¯
²»ÒªÓÃISAMÀàÐͱí
ISAMÊÇmysql×îÔçµÄ±íÀàÐÍ£¬Ò²ÊÇ·ÇÊÂÎñÐÔ±íÀàÐÍ
ÏÖÔÚÒѾ±»MyISAM±íÀàÐÍËùÈ¡´ú
MySQL4.1µÄ°æ±¾ÀïËäÈ»»¹±£ÁôµÄÓÐISAM±íÀàÐÍ
µ«ÒѾ²»ÍƼöʹÓÃ
´ÓMysql5¿ªÊ¼£¬ISAM±íÀàÐÍÒѱ»É¾µô
Mysql´Ó3.23¿ªÊ¼ÒýÈëMyISAMºÍHEAP±íÀàÐÍ
MyISAMÓÃÀ´Ìá¸ßISAM±íÀàÐÍÐÔÄÜ
HEAP¾ÍÊÇËùνÄÚ´æ±í
Mysql´Ó3.23.25¿ªÊ¼ÒýÈëMERGE±íÀàÐÍ
ÕâÖÖ±íÀàÐÍÔÊÐí°ÑһЩMyISAM±íµ±×÷Ò»¸ö±íÀ´²Ù×÷
MyISAM¡¢HEAP¡¢MERGEÕâÈýÖÖ±íÀàÐͶ¼ÊÇ·ÇÊÂÎñÐÔ±íÀàÐÍ
×¢£ºHEAP±íÀàÐÍÒѸÄÃûΪMEMORY±íÀàÐÍ
InnoDBºÍBDBÊÇËùνµÄÊÂÎñÐÔ±íÀàÐÍ
Ò²¾ÍÊÇÖ§³Ö»Ø¹öµÄ±íÀàÐÍ
´óÔ¼´ÓMysql3.23ºóÃæµÄһЩ°æ±¾¿ªÊ¼±»Ö§³Ö
´ÓMysql4.0¿ªÊ¼±»È±Ê¡Ö§³Ö
EXAMPLE±íÀàÐÍ´ÓMysql4.1.3¿ªÊ¼±»ÒýÈë
ËûÆäʵûʲôÓÃ
¼È²»
Ïà¹ØÎĵµ£º
ʹÓÃmysqlÓÖÓöµ½ÎÊÌâÁË£¬Õâ´ÎÊǹØÓÚÂÒÂëµÄ...
ÆäʵÎÒÒ²±È½ÏÁ˽â±àÂëµÄÎÊÌ⣬Ҳ֪µÀÂÒÂë²úÉúµÄÔÀí£¬¶øÇÒÍøÉ϶ÔmysqlµÄÂÒÂëÎÊÌâÒ²ÓбȽ϶àµÄ½â´ð£¬
µ«ÊǽñÌìÎÒÓöµ½µÄÕâ¸öÂÒÂëÈ´±È½ÏÆæ¹Ö,ÔÚwhenÓï¾äÖвúÉúÁËÆæ¹ÖµÄÂÒÂë¡£
create table my_table(id int, name varchar(50), born DateTime);
insert into my_table val ......
select id from message where author_id in (select followed_id from Relation where follower_id=1) order by id desc ºÍ ·Ö±ðÖ´ÐÐ $userlist = select followed_id from Relation where follower_id=1 ÔÙ select id from message where author_id in ($userlist) order by id desc ¾¹È»ÓÐÁ½¸öÊýÁ ......
http://hi.baidu.com/xuwanbest/blog/item/193fd93dda509303bba167e3.html
http://wangdei.javaeye.com/blog/214265
¹ØÓÚ MySQL µ÷ÓÅ
ÓÐ 3 ÖÖ·½·¨¿ÉÒÔ¼Ó¿ì MySQL ·þÎñÆ÷µÄÔËÐÐËٶȣ¬Ð§Âʴӵ͵½¸ßÒÀ´ÎΪ£º
Ìæ»»ÓÐÎÊÌâµÄÓ²¼þ¡£
¶Ô MySQL ½ø³ÌµÄÉèÖýøÐе÷ÓÅ¡£
¶Ô²éѯ½øÐÐÓÅ»¯¡£
ǨÒƵ½ DB2
ÄúÕýÔÚÑ°ÕÒÒ»Öָɾ»À ......
×î½üÒ»Ö±ÔÚ½øÐÐPenroseÁ¬½ÓMysqlµÄ³¢ÊÔ£¬¿É×ÜÊÇÌáʾÎÞ·¨Á¬½Óµ½Mysql£¬ÎÞÂÛÊǼì²é¶Ë¿ÚÊÇ·ñ¿ªÆô£¬ÉèÖÃMysqlÔ¶³Ì·ÃÎÊȨÏ޵ȶ¼²»¹ÜÓ㬺óÀ´ÔÚPenroseµÄ¹ÙÍøÕÒµ½Ò»¸ö½¨Á¢ÑùÀýÊý¾Ý¿â¼°ÉèÖÃÔ¶³ÌÁ¬½ÓµÄÎĵµ£¬Ã»Ïëµ½Ò»¾Ù³É¹¦£¬Í´¿ì°¡£¡
ÏÂÃæ¾Í°ÑÎĵµºÍ´ó¼Ò¹²Ïíһϣ¡£¨ÊÇÓ¢ÎÄ£¬´ó¼Ò¾Í´ÕºÏ×Å¿´Ï°ɣ¡ÒòΪ×î½ü¸ãPenroseÌ«ÀÛÁË£¬ ......
ÍøÉϺܶàдÔÚwindowsÏÂÎÞ·¨ÔØÈëmysqlÀ©Õ¹½â¾ö°ì·¨£¬µ«ÊÇÔÚliunxϵľÍû¼¸¸ö£¬ÒÔÏÂÊÇÔÚliunxϵĽâ¾ö°ì·¨
ÖØ×°ºóphp²»»á×Ô¶¯°Ñmysql.soÀ©Õ¹¼ÓÉÏÈ¥,Òª
sudo vim /etc/php5/apache2/conf.d/pdo.ini
¼ÓÈëextension=mysql.so¾Í¿ÉÒÔÁË
ÆäʵҲ¿ÉÒÔÔÚ /etc/php5/apache2/php.iniÖмÓÈë
Ò²¿ÉÒÔÔÚ/etc/php5/apache2/conf. ......