dz̸MysQLÖÐHANDLERÓï·¨½éÉܼ°Ê¹ÓÃ
½ñÌìС±àÒªºÍ´ó¼Ò˵µÄÊÇhandlerµÄÓ÷¨£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
HANDLER tbl_name OPEN [ AS alias ]
HANDLER tbl_name READ index_name { = | >= | <= | < } (value1,value2,...)
[ WHERE where_condition ] [LIMIT ... ]
HANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }
[ WHERE where_condition ] [LIMIT ... ]
HANDLER tbl_name READ { FIRST | NEXT }
[ WHERE where_condition ] [LIMIT ... ]
HANDLER tbl_name CLOSE
HANDLERÓï¾äÌṩͨÍù±í´æ´¢ÒýÇæ½Ó¿ÚµÄÖ±½ÓͨµÀ¡£HANDLER¿ÉÒÔÓÃÓÚMyISAMºÍInnoDB±í¡£
HANDLER...OPENÓï¾äÓÃÓÚ´ò¿ªÒ»¸ö±í£¬Í¨¹ýºóÐøµÄHANDLER...READÓï¾ä½¨Á¢¶ÁÈ¡±íµÄͨµÀ¡£±¾±íÄ¿±ê²»»á±»ÆäËüÏ̹߳²Ïí£¬Ò²²»»á¹Ø±Õ£¬Ö±µ½Ï̵߳÷ÓÃHANDLER...CLOSE»òÏß³ÌÖÐֹʱΪֹ¡£Èç¹ûÄúʹÓÃÒ»¸ö±ðÃû´ò¿ª±í£¬ÔòʹÓÃÆäËüHANDLERÓï¾ä½øÒ»²½²ÎÔıíÊDZØÐëʹÓô˱ðÃû£¬¶ø²»ÄÜʹÓñíÃû¡£
Èç¹û±»Ö¸¶¨µÄË÷ÒýÂú×ã¸ø¶¨µÄÖµ²¢ÇÒ·ûºÏÁËWHEREÌõ¼þ£¬ÔòµÚÒ»¸öHANDLER...READÓ﷨ȡ³öÒ»ÐС£Èç¹ûÄúÓÐÒ»¸ö¶àÁÐË÷Òý£¬ÔòÖ¸¶¨Ë÷ÒýÁÐֵΪһ¸öÓöººÅ¸ô¿ªµÄÇåµ¥¡£¼È¿ÉÒÔΪË÷ÒýÖеÄËùÓÐÁÐÖ¸¶¨Öµ£¬Ò²¿ÉÒÔΪË÷ÒýÁеÄ×î×ó±ßµÄǰ׺ָ¶¨Öµ¡£¼ÙÉèÒ»¸öË÷Òý°üÀ¨Èý¸öÁУ¬Ãû³ÆΪcol_a, col_b,ºÍcol_c£¬²¢°´´Ë˳ÐòÅÅÁС£HANDLERÓï¾ä¿ÉÒÔΪË÷ÒýÖеÄËùÓÐÈý¸öÁÐÖ¸¶¨Öµ£¬»òÕßΪһ¸ö×î×ó±ßǰ׺Öеĸ÷ÁÐÖ¸¶¨Öµ¡£¾ÙÀý˵Ã÷£º
HANDLER ... index_name = (col_a_val,col_b_val,col_c_val) ...
HANDLER ... index_name = (col_a_val,col_b_val) ...
HANDLER ... index_name = (col_a_val) ...
µÚ¶þ¸öHANDLER...READÓï·¨°´Ë÷ÒýµÄ˳Ðò´Ó±íÖÐÈ¡³öÒ»ÐС£Ë÷ÒýµÄ˳Ðò·ûºÏWHEREÌõ¼þ¡£
µÚÈý¸öHANDLER...READÓï·¨°´×ÔÈ»ÐеÄ˳Ðò´Ó±íÖÐÈ¡³öÒ»ÐС£×ÔÈ»ÐеÄ˳Ðò·ûºÏWHEREÌõ¼þ¡£µ±ÏëÒª¶ÔÕû¸ö±í½øÐÐɨÃèʱ£¬´ËÓï¾ä±ÈHANDLER tbl_name READ index_name¸ü¿ì¡£×ÔÈ»ÐеÄ˳ÐòÖ¸µÄÊÇÐд洢ÔÚMyISAM±íÊý¾ÝÎļþµÄ˳Ðò¡£±¾Óï¾äÒ²ÊÊÓÃÓÚInnoDB±í£¬µ«ÊÇÒòΪûÓжÀÁ¢µÄÊý¾ÝÎļþ£¬ËùÒÔûÓÐÕâÀà¸ÅÄî¡£
²»Ê¹ÓÃLIMIT×Ó¾äʱ£¬ËùÓÐÐÎʽµÄHANDLER...READÓï¾ä¾ùֻȡ³öÒ»ÐС£ Èç¹ûÒª·µ»Ø¶à¸öÐУ¬Ó¦¼ÓÈëÒ»¸öLIMIT×Ӿ䡣±¾Óï¾äÓÚSELECTÓï¾äµÄÓï·¨Ò»Ñù¡£
HANDLER...CLOSEÓÃÓڹرÕʹÓÃHANDLER...OPEN´ò¿ªµÄ±í¡£
×¢ÊÍ£ºÒªÊ¹ÓÃHANDLER½Ó¿ÚÀ´²éÔÄÒ»¸ö±íµÄPRIMARY KEY£¬Ó¦Ê¹ÓôøÒýºÅµÄʶ±ð·û`PRIMARY`£º
HANDLER tbl_name READ `PRIM
Ïà¹ØÎĵµ£º
ÓÉÓÚ×î½üÒ»Ö±ÔÚÁ˽âmysql¡£¸÷ÖÖ±íÀàÐ͵ÄÊý¾Ý´æ´¢ÒÔ¼°Ïà¹ØÏÞÖƾÍÊDZØÐëÁ˽âµÄ·½ÃæÁË¡£
×Ô¼ºµÄ·þÎñÆ÷»·¾³£ºOS Cent OS ext3£¬memory 4G£¬ disk 2T block size 4K¡£
¾µ÷²é£¬linuxÏÂÎļþ×î´óÊÇ´æÔÚÏÞÖƵġ£È¥googleÉÏËÑÁËËÑ£¬´ó¼Ò˵·¨²»Ò»£¬×îÖÕ×Ô¼º»¹ÊÇÕÒµ½±È½Ï¹Ù·½µÄ˵¡£Ïê¼ûhttp://en.wikipedia.org/wiki/Ext3 ËùÒÔ× ......
ÏñMySQLÕâÑùµÄ¹ØϵÐÍÊý¾Ý¿â¹ÜÀíϵͳ£¬ËüÃǵĻù´¡ÊÇÔÚÊý¾Ý¿âµÄ±íÖ®¼ä´´½¨¹ØϵµÄÄÜÁ¦¡£Í¨¹ý·½±ãµØÔÚ²»Í¬±íÖн¨Á¢¼Ç¼µ½¼Ç¼µÄÁªÏµ£¬RDBMS¿ÉÒÔÀûÓò»Í¬µÄ·½·¨·ÖÎöÊý¾Ý£¬Í¬Ê±±£³ÖÊý¾Ý¿âÒÔϵͳµÄ·½Ê½¡¢×îСµÄÈßÓà½øÐÐ×éÖ¯¡£
¼òµ¥ÃèÊö£º
ÕâЩ¹Øϵ»ù±¾ÉÏÒÀ¿¿Íâ¼ü½øÐйÜÀí£¬ÔÚ¹ØϵÖÐËùÓбíÖоßÓÐÏàͬº¬ÒåµÄ×Ö¶Î×÷Ϊ¹«¹²²¿·ÖÀ´Á¬½Ó ......
CREATE [OR REPLACE] [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
VIEW view_name [(column_list)]
AS select_statement
[WITH [CASCADED | LOCAL] CHECK OPTION]
¸ÃÓï¾äÄÜ´´½¨ÐµÄÊÓͼ£¬Èç¹û¸ø¶¨ÁËOR REPLACE×Ӿ䣬¸ÃÓï¾ä»¹ÄÜÌæ»»ÒÑÓеÄÊÓͼ¡£s ......
mysql Êý¾Ý¿âĬÈϵÄÁ¬½ÓÖ»ÄÜÔÚ±¾»úÁ¬½Ó£¬Ô¶³ÌÁ¬½Ó±ØÐëÊÚȨ¡£
´úÂë: È«Ñ¡
¡¡GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%'IDENTIFIED
BY 'mypassword' WITH GRANT
OPTION;Èç¹ûÄãÏëÔÊÐíÓû§myuser´ÓipΪ192.168.1.6µÄÖ÷»úÁ¬½Óµ½mysql·þÎñÆ÷£¬²¢Ê¹ÓÃ
mypassword×÷ΪÃÜÂë
´úÂë: GRANT ALL PR ......
SQL±ê×¼ÔÚÊý¾Ý´æ´¢µÄÎïÀí·½ÃæûÓÐÌṩ̫¶àµÄÖ¸ÄÏ¡£SQLÓïÑÔµÄʹÓöÀÁ¢ÓÚËüËùʹÓõÄÈκÎÊý¾Ý½á¹¹»òͼ±í¡¢±í¡¢ÐлòÁÐϵĽéÖÊ¡£µ«ÊÇ£¬´ó²¿·Ö¸ß¼¶Êý¾Ý¿â¹ÜÀíϵͳÒѾ¿ª·¢ÁËһЩ¸ù¾ÝÎļþϵͳ¡¢Ó²¼þ»òÕßÕâÁ½ÕßÀ´È·¶¨½«ÒªÓÃÓÚ´æ´¢Ìض¨Êý¾Ý¿éÎïÀíλÖõķ½·¨¡£ÔÚMySQLÖУ¬InnoDB´æ´¢ÒýÇ泤ÆÚÖ§³Ö±í¿Õ¼äµÄ¸ÅÄ²¢ÇÒMySQL·þÎñÆ÷ÉõÖÁÔÚ ......