mysqlËæ»úÊý¾ÝÉú³É²¢²åÈë
dblpÊý¾Ý¿âÖÐÒýÓÃÐÅÏ¢ºÜÉÙ£¬Æ½¾ùһƪÂÛÎÄÒýÓÃ0.2ƪ¡£Ê¹ÓÃdblp×öʵÑéÊý¾Ý¼¯µÄijƪÂÛÎÄÌáµ½£¬¿ÉÒÔËæ»úÌí¼ÓÒýÓÃÐÅÏ¢¡£ÊÜ´ËÆô·¢£¬ÎÒ´òËãΪÿһƪÂÛÎĶ¼Ìí¼Ó20ƪËæ»úÒýÓã¬ÓÚÊǾÍд³öÁËÈçϵÄsqlÓï¾ä£º
String sql = "insert into citation(pId1,pId2) values( (select pId from papers limit ?,1),(select pId from papers
limit ?,1))";
ʹÓÃpreparedstatement£¬ÒÔbatch·½Ê½Ìá½»Êý¾Ý¿â¡£
µÚÒ»¸ö²ÎÊýÊÇpaperµÄrowidÐÅÏ¢£¬´Ó0~N£¨NΪpapersµÄtotal row£©¡£µÚ¶þ¸ö²ÎÊýÊÇjavaÉú³ÉµÄ20¸ö²»Öظ´µÄËæ»úÊý£¬·¶Î§ÊÇ0-N¡£È»ºóǶÌ×ÔÚforÑ»·Àÿ1wÌõÊý¾ÝÌá½»¸øÊý¾Ý¿âÒ»´Î¡£
Õâ¶Î´úÂëÇÉÃîÔËÓÃlimitµÄÌØÐÔÍê³ÉËæ»úÑ¡tuple£¬±¾À´ÊÇ°µ°µµÃÒâµÄ¡£×ÔÒÔΪ°ÑËùÓеÄselect¶¼½»¸øÊý¾Ý¿âÈ¥×öÁË£¬Ê¡È¥ÁËͨ¹ýjdbcµÄ¶à´ÎÁ¬½Ó£¬Ó¦¸ÃÊǺܿì¾Í¿ÉÒÔÔËÐÐÍê³ÉµÄ¡£ÄÄÖª£¬²åÁ˲»¹ý10wÌõ£¨10000*10£©Êý¾Ý£¬¾ÍºÄʱ22·ÖÖÓÖ®¶à¡£×îÖÕµÄʵÑéÐèÒª²åÈë400wÌõÊý¾Ý£¬Ò²¾ÍÊÇ˵Ҫ»¨14h×óÓÒ¡£
ÓÚÊÇ¿ªÊ¼·´Ë¼£¬²»¶Ï×öдÀàËƵijÌÐò²éÕÒʱ¼äÆ¿¾±£¬×îÖÕËø¶¨ÔÚselect limit£¬Õâ¸ö²Ù×÷¼«ºÄʱ¼ä¡£µ±³õÑ¡ÓÃlimit£¬ÔÒòÔÚÓÚ£ºËæ»úÉú³ÉµÄÊÇÊý×Ö£¬Òª°ÑÊý×ÖÓ³Éäµ½tuple£¬Ò²¾ÍÊǶÔÓ¦µ½rowid£»ÓÉÓÚpapers±íµÄÖ÷¼ü²¢·ÇµÝÔöint£¬ËùÒÔĬÈϵÄrowid²»´æÔÚ¡£ºóÀ´Ò»Ï룬¿ÉÒÔÔÚpapers±íÉÏÏÈÔö¼ÓÒ»¸öauto_incrementµÄtempÁУ¬Íê³Écitation²åÈëºóÔÙɾ³ý¡£ÕâÑùsqlÓï¾ä¾Í¸Ä³ÉÁË£º
String sql = "insert into citation(pId1,pId2) values((select pId from papers where temp=?), (select pId from
papers where temp=?))";
ÔÙÒ»´Î²åÈë10wÌõÊý¾Ý£¬ºÄʱ38s¡£Ð§ÂÊ´ó·ùÌá¸ß£¬µ«²»ÖªµÀ»¹¿É²»¿ÉÒÔ½øÒ»²½ÓÅ»¯¡£
Ïà¹ØÎĵµ£º
1¡¢ÔÚÅäÖÃmysqlʵÀýµÄÓïÑÔÑ¡Ïîʱ£¬Ñ¡Ôñutf-8
2¡¢ÔÚhtml,phpÒ³ÃæÖÐ ¼ÓÉÏ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />£¬Èç¹û²»ÐÐÔÙÔÚ phpÎļþ Æðʼ´¦¼Ó header("Content-Type:text/html;charset=utf-8");
3¡¢ÔÚphpÖÐ×öÊý¾Ý¿âÁ¬½Óʱ£¬ÎÒÓõÄʱpdoµÄÐÎʽ£¬Ë ......
niginx°²×°Á÷³Ì
Èí¼þÏÂÔØ:--->
mkdir -p /home/dancebear/programe
cd /home/dancebear/programe
wget http://sysoev.ru/nginx/nginx-0.6.31.tar.gz
wget http://www.php.net/get/php-5.2.6.tar.gz/from/this/mirror
wget http://php-fpm.anight.org/downloads/head/php-5.2.6-fpm-0.5.8.diff.gz
wget http://dev ......
¹ýÂËÆ÷Ìõ¼þ
mysql.query contains "SELECT"
..
..
..
..
MySQL Protocol
Packet Length: 168
Packet Number: 0
Command
Command: Query (3)
State ......
mysql¿ÉÒÔÔËÐÐÔÚ²»Í¬sql modeģʽÏÂÃ棬sql modeģʽ¶¨ÒåÁËmysqlÓ¦¸ÃÖ§³ÖµÄsqlÓï·¨£¬Êý¾ÝУÑéµÈ£¡
²é¿´Ä¬ÈϵÄsql modeģʽ£º
select @@sql_mode;
ÎÒµÄÊý¾Ý¿âÊÇ£º
STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
ÔÚ´ËģʽÏÂÃ棬Èç¹û²åÈëµÄÊý¾ÝµÄ³¤¶È´óÓÚ¶¨ÒåµÄ³¤¶È£¬ÄÇô¾Í»á±¨´í£¡
......
[ ÅäÖÃ ]
Ö´ÐÐÔöÁ¿±¸·ÝµÄÇ°ÌáÌõ¼þÊÇMySQL´ò¿ªlog-binÈÕÖ¾¿ª¹Ø£¬ÀýÈçÔÚmy.ini»òmy.cnfÖмÓÈë log-bin=C:/Program Files/MySQL/MySQL Server 6.0/Data/mysql-bin “log-bin=”ºóµÄ×Ö·û´®ÎªÈÕÖ¾¼ÇÔØĿ¼£¬Ò»°ã½¨Òé·ÅÔÚ²»Í¬ÓÚmysqlÊý¾ÝĿ¼µÄ´ÅÅÌÉÏ¡£
[ ÍêÈ«±¸·Ý]
¼Ù¶¨ÐÇÆÚÈÕÏÂÎç1µãÖ´ÐÐÍêÈ«±¸·Ý£¬ÊÊÓÃÓÚMyISAM ......