Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

mysqlË÷ÒýµÄʹÓü°Óï¾äÓÅ»¯

Ò»:mysqlÀïÄ¿Ç°Ö»Ö§³Ö4ÖÖË÷Òý·Ö±ðÊÇ:b-tree,full-text,hashÒÔ¼°r-treeË÷Òý b-treeË÷ÒýÓ¦¸ÃÊÇmysqlÀï×î¹ã·ºµÄË÷ÒýµÄÁË,³ýÁËarchive,»ù±¾ËùÓеĴ洢ÒýÇ涼֧³ÖËü. 1.b-treeÔÚmyisamÀïµÄÐÎʽºÍinnodbÉÔÓв»Í¬ ÔÚinnodbÀïÃæÓÐÁ½ÖÖÐÎ̬:ÆäÒ»ÊÇprimary keyÐÎ̬Æäleaf nodeÀï´æ·ÅµÄÊÇÊý¾Ý.¶øÇÒ²»½ö´æ·ÅÁËË÷Òý¼üµÄÊý¾Ý,»¹´æ·ÅÁËÆäËû×ֶεÄÊý¾Ý.Æä¶þÊÇsecondary index,Æäleaf nodeºÍÆÕͨµÄb-tree²î²»¶à,Ö»ÊÇ»¹´æ·ÅÁËÖ¸ÏòÖ÷¼üµÄÐÅÏ¢. ¶øÔÚmyisamÀï,Ö÷¼üºÍÆäËûµÄ²¢Ã»ÓÐÌ«´óÇø±ð.²»¹ýºÍinnodb²»Ì«Ò»ÑùµÄµØ·½ÊÇ,ÔÚmyisamÀï,leaf nodeÀï´æ·ÅµÄ²»ÊÇÖ÷¼üµÄÐÅÏ¢,´æµÄÊÇÖ¸ÏòÊý¾ÝÎļþÀïµÄ¶ÔÓ¦Êý¾ÝÐеÄÐÅÏ¢. 2.hashË÷Òý,Ä¿Ç°ÎÒËùÖªµÀµÄ¾ÍÖ»ÓÐmemoryºÍndb clusterÖ§³ÖÕâÖÖË÷Òý. hashË÷ÒýÓÉÓÚÆä½á¹¹,ËùÒÔÔÚÿ´Î²éѯµÄʱºòÖ±½ÓÒ»´Îµ½Î»²»ÐÐb-treeÄÇÑù,Ò»µãµãµÄÇ°½ø,ËùÒÔhashË÷ÒýµÄЧÂʸßÓÚb-tree.µ«hashÒ²ÓÐȱµã,Ö÷ÒªÈçÏÂ: (1)ÓÉÓÚ´æ·ÅµÄÊÇhashÖµ,ËùÒÔ½öÖ§³Ö<=>ÒÔ¼°in²Ù×÷. (2)hashË÷ÒýÎÞ·¨Í¨¹ý²Ù×÷Ë÷ÒýÀ´ÅÅÐò,ÕâÊÇÒòΪ´æ·ÅµÄʱºò¾­¹ýhash¼ÆËã,µ«ÊǼÆËãµÄhashÖµºÍ´æ·ÅµÄ²»Ò»¶¨ÏàµÈ,ËùÒÔÎÞ·¨ÅÅÐò. (3)ÔÚ×éºÏËùÒÔÀï,ÎÞ·¨¶Ô²¿·ÖʹÓÃË÷Òý. (4)²»ÄܱÜÃâÈ«±íɨÃè,Ö»ÊÇÓÉÓÚÔÚmemory±íÀïÖ§³Ö·ÇΨһֵhashË÷Òý,¾ÍÊDz»Í¬µÄË÷Òý¼ü,¿ÉÄÜ´æÔÚÏàͬµÄhashÖµ. (5)µ±´æÔÚ´óÁ¿ÏàͬhashÖµµÃʱºò,hashË÷ÒýµÄЧÂÊ»á±äµÍ. 3.full-textË÷Òý full-textÔÚmysqlÀï½öÓÐmyisamÖ§³ÖËü,¶øÇÒÖ§³Öfull-textµÄ×Ö¶ÎÖ»ÓÐchar,varchar,ÒÔ¼°textÊý¾ÝÀàÐÍ,full-textÖ÷ÒªÊÇÓÃÀ´´úÌælike "%***%"ЧÂʵÍϵÄÎÊÌâµÄ. 4.r-treeË÷Òý r-treeÔÚmysqlºÜÉÙʹÓÃ,½öÖ§³ÖgeometryÊý¾ÝÀàÐÍ,Ö§³Ö¸ÃÀàÐ͵Ĵ洢ÒýÇæÖ»ÓÐmyisam,bdb,innodb,ndb,archive¼¸ÖÖ.Ïà¶ÔÓÚb-tree,r-treeµÄÓÅÊÆÔÚÓÚ·¶Î§²éÕÒ. ¶þ:mysqlÀïsqlÓï¾äÖµµÃ×¢ÒâµÄµØ·½ 1.myisamÀïËùÒÔ¼üµÄ³¤¶È½öÖ§³Ö1000×Ö½Ú,innodbÊÇ767. 2.blobºÍtext×ֶνöÖ§³Öǰ׺Ë÷Òý. 3.ʹÓÃ!=ÒÔ¼°<>²»µÈÓÚµÄʱºòmysql²»Ê¹ÓÃË÷Òý. 4.µ±ÔÚ×Ö¶Îʱºòº¯ÊýµÄʱºò,mysqlÎÞ·¨Ê¹ÓÃË÷Òý,ÔÚjoinµÄʱºòÌõ¼þ×Ö¶ÎÀàÐͲ»Ò»ÖµÄʱºò,mysqlÎÞ·¨Ê¹ÓÃË÷Òý,ÔÚ×éºÏË÷ÒýÀïʹÓ÷ǵÚÒ»¸öË÷ÒýʱҲ²»Ê¹ÓÃË÷Òý. 5.ÔÚʹÓÃlikeµÄʱºò,ÒÔ%¿ªÍ·,¼´"%***"µÄʱºòÎÞ·¨Ê¹ÓÃË÷Òý,ÔÚʹÓÃorµÄʱºò,ÒªÇóorÇ°ºó×ֶζ¼ÓÐË÷Òý. ÓÐʱºòmysql query optimizer»áÈÏΪʹÓÃË÷Òý²¢²»ÊÇ×îÓżƻ®,ËùÒÔ²»Ê¹ÓÃË÷Òý,¿ÉÒÔÔÚsqlÓï¾äÀï¿ÉÒÔÓÃuse,force index,µ±È»ÓÐʱºòʹÓÃÒ²²»»á±È²»Óÿì,ËùÒÔÐèÒªºö


Ïà¹ØÎĵµ£º

mysql UDF+triggerµÄÉñÆæħÁ¦

  1.ʲôÊÇUDF? UDF(user-defined function)ÊÇmysqlΪÓû§ÌṩµÄ×Ô¶¨Ò庯ÊýµÄÀ©Õ¹½Ó¿Ú¡£Ëü±¾ÖÊÉϺÍmysqlÌṩµÄmax¡¢minºÍcountµÈº¯ÊýÀàËÆ¡£ 2.UDF¿ÉÒÔ×öʲô? UDFÊÇ×Ô¶¨Ò庯Êý£¬ËùÒÔËüÄÜ×öʲôÍêÈ«È¡¾öÓÚÄãµÄʵÏÖ¡£UDF¿ÉÒÔÔÚÆÕͨµÄsql¡¢triggerÒÔ¼°store procedure±»µ÷ÓᣠÈç¹û×Ô¶¨ÒåÒ»¸ötcp_send(ip,port,msg)µ ......

°²×°¡¢ÉèÖÃÓëÆô¶¯MySqlÂÌÉ«°æµÄ·½·¨

1¡¢½âѹ mysql-noinstall-5.1.30-win32.zip
2¡¢ÔÚ F Å̽¨Á¢Ä¿Â¼ MySql\MySqlServer5.1\
3¡¢°Ñ½âѹµÄÄÚÈݸ´ÖƵ½  F:\MySql\MySqlServer5.1\
4¡¢ÔÚ F:\MySql\MySqlServer5.1\ ÖÐÕÒ my-large.ini °ÑËü¸´ÖÆ³É my.ini
5¡¢ÔÚ my.ini ÖÐÕÒ [mysqld] £¬Ìí¼ÓÒÔÏÂÓï¾ä;
basedir="F:/MySql/MySqlServer5.1/"
datadir="F:/My ......

MysqlµÄ°²×°

MysqlµÄ°²×°Îļþ¿ÉÒÔÖ±½Óµ½ http://www.mysql.com ÏÂÔØ£¬»ñµÃfor win32µÄ.zip°ü£¬½¨ÒéÑ¡Ôñ4.0.20d°æ±¾¡£
¡¡¡¡ÏÂÔØ»ñµÃMysqlµÄfor win32°²×°°üºó£¬ÓÃwinzip½âѹËõ£¬Ö±½ÓÔËÐÐsetup.exe£¬ÐèҪעÒâµÄÊÇÑ¡ÔñÒ»¸ö°²×°Â·¾¶£¬µ±È»£¬°²×°Â·¾¶¿ÉÒÔÈÎÒ⣬½¨ÒéÑ¡ÔñC:\MySQLĿ¼¡£°²×°Íê³ÉºóMySQLÒ²¾ÍÍê³ÉÁË¡£Ä¬ÈϵÄÓû§ÃûÊÇroot£¬ÃÜÂë ......

mysql ³£ÓÃÃüÁî

MySQL ÃüÁîÐÐ
µÚÒ»ÕС¢mysql·þÎñµÄÆô¶¯ºÍÍ£Ö¹
net stop mysql
net start mysql
µÚ¶þÕС¢µÇ½mysql
Óï·¨ÈçÏ£º mysql -uÓû§Ãû -pÓû§ÃÜÂë
¼üÈëÃüÁîmysql -uroot -p£¬ »Ø³µºóÌáʾÄãÊäÈëÃÜÂ룬ÊäÈë12345£¬È»ºó»Ø³µ¼´¿É½øÈëµ½mysqlÖÐÁË£¬mysqlµÄÌáʾ·ûÊÇ£º
mysql>
×¢Ò⣬Èç¹ûÊÇÁ¬½Óµ½ÁíÍâµÄ»úÆ÷ÉÏ£¬ÔòÐèÒª¼ÓÈëÒ»¸ö² ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ