1 [07-25 13:15:06:511:DEBUG:CUDThread.run():246] µ±Ç°´ý´¦ÀíÊ£ÓàÊýÁ¿£º23473 2 [07-25 13:15:10:948:DEBUG:CUDThread.run():219] ÐÂÔöÊý¾Ý²åÈëÓ°ÏìÐÐÊý£º5000 ºÄʱ£º4434 3 [07-25 13:15:10:950:DEBUG:CUDThread.run():246] µ±Ç°´ý´¦ÀíÊ£ÓàÊýÁ¿£º42028 4 [07-25 13:15:14:666:DEBUG:CUDThread.run():219] ÐÂÔöÊý¾Ý²åÈëÓ°ÏìÐÐÊý£º5000 ºÄʱ£º3715 5 [07-25 13:15:14:668:DEBUG:CUDThread.run():246] µ±Ç°´ý´¦ÀíÊ£ÓàÊýÁ¿£º49338
Ò²ÐíÓëÎÒµ±Ç°±Ê¼Ç±¾Ó²ÅÌÓйØϵ£»µçÄÔÐÔÄÜÕ¼ÓÃÎÊÌ⣻
²åÈëËÙ¶ÈÊÇÂýÁË£¬ÎÒÃÇÀ´¿´¿´²éѯËٶȰɣ¬
ÎÒÃÇ¿ÉÒÔ¿´µ½²åÈëËٶȿìºÜ¶à£»
µ±È»´ËʱµÄÊý¾ÝÁ¿È·ÊµÃ´ÓÐ֮ǰµÄ¶à£¬ÒòΪ²âÊÔÎÊÌ⣬²åÈëµÄÊý¾ÝµÄȷʵºÜÂý£¬
Èç¹ûÊÇmysql Êý¾Ý¿â£¬»¹ÐèÒª¼ÓÈëÁªºÏË÷Òý²éѯ²Å»á·±¶ÌáÉýÐÔÄÜ£»mysql²åÈëËٶȻá±ÈsqliteºÃÒ»µã£¬ÒòΪsqlie±¾Éí¾Í²»ÊÊÓÃÓÚ´óÐÍÊý¾Ý¼¯ºÏ£» µÚËÄÕ ÆäʵÒÔÉϹ¤×÷Ö»ÊÇ×öµ½ÁËË÷ÒýÓÅ»¯ÎÊÌ⣻µ«ÊÇÒ²µÖ²»×¡Ô½À´Ô½¶àµÄÊý¾Ý£»¶Ô²»¶Ô£¿ËùÒÔ»¹ÊǵÄÑ°ÇóÆäËû·½Ê½À´½â¾öÎÊÌ⣻
ÎÒÃÇÏÈÀ´·ÖÎöÇé¿ö
¿ÉÒÔ½¨Á¢·ÖÇø±íÐÎʽ£»µ«Êǽ¨Á¢·ÖÇø±í£¬Êý¾ÝÒ²Ö»ÊÇÔÚÒ»¸ö±íÄÚ´óhash¼¯ºÏ£¬È»ºóÇø·ÖµÄСhash¼¯ºÏ£¬È»ºó¾ÍËãmysqlÕâÖÖ¹Ù·½½¨ÒéµÄ·ÖÇø±í¶¼ÊÇ200ÍòÌõÊý¾Ý£»
ËùÒÔûÓг¢ÊÔ¹ý£»ÓÐÐËȤµÄͬѧ¿ÉÒÔÑо¿Ñо¿£»
ÎÒÏëµ½µÄµÚ¶þÖÖ·½Ê½£¬·Ö±í£¬Ö®Ç°ÔÚ×öÓÎÏ·ÔËÓªºǫ́£¬½ÓÊÜÀ´Ö®¶à¸öÓÎÏ·µÄÔËÓªÈÕÖ¾Êý¾Ý£¬¾Í²ÉÓÃÁËÕâÖÖ·½Ê½£¬·Ö±í£¬Ã¿Ò»ÌìÒ»ÕÅ±í£¬À´»®·Ö£»
ËùÒÔÎҺܿìÓÖÏëµ½ÁËÕâÖÖ·½Ê½£¬ÎÒÒÔÿһ¸ö¹Ø¿¨»®·Öͨ¹ØÊý¾Ý¼Ç¼£¬
¿ÉÊÇ×ÐϸһÏë¿Ï¶¨²»Ðа¡£¬ÒòΪ°´ÕÕÏÖÔÚÏûÏûÀÖÕâÖÖÓÎÏ·À´Ëµ1200¹Ø£¬1000¶àÕÅ±í£¬Î¬»¤¶¼µÃæËÀ£»¶øÇÒÔ½ÍùºóÔ½¸üÐÂÔ½¶à£¬ÒÀÈ»²»¿ÉÐУ¡
ÈκÎÓÎÏ·Ö»ÒªÔÚÉú´æÖÜÆÚÄÚ£¬¾ÍÓÐÓÐÈ˼ÓÈ룬ÓÐÈËÁ÷ʧ£»
ÄÇôÏûÏûÀÖÕâÖֹؿ¨ÀàµÄÓÎÏ·£¬ÄÇôÊý¾ÝÁ¿ÓÀÔ¶¶¼ÔÚÇ°Ãæ¹Ø¿¨£¬Ô½ÍùºóÔ½ÉÙ£¬¾Í¸úÎÒÇ°Ãæ˵µÄÒ»Ñù£¬Ã¿Ò»¹Ø¿¨¶¼»áÁ÷ʧ0.xxx%£»
ÄÇôÎÒÃÇ¿ÉÒÔÉè¼Æ30ÕÅ±í£¬30ÕÅ×ÜÄܽÓÊÜÁË°É£¿
ÆðÂëÎÒÊÇÄܽÓÊÜÁË£»
¿ÉÊÇÈçºÎÓÅÑŵÄÀûÓÃ30ÕűíÊý¾ÝµÄÄØ£¿
ÎÒÃÇ·ÖÎö¿ÉµÃÔ½¿¿Ç°µÄ¹Ø¿¨£¬Êý¾ÝÔ½¶à£¬
ÄÇôÎÒÃÇÉè¼ÆÇ°800¹Ø¿¨µÄÊý¾Ý´æÈë20ÕÅ±í£»
ºóÃæµÄËùÒÔ±í¼Ç¼µ½Ê£ÓàµÄ10ÕűíÖУ»
´´½¨±í£¬»ñÈ¡±íÃûµÄ¼òÒ×Ëã·¨£»
* »ñÈ¡±íÃû 3 * point String getTableName(int point) { 8 int tableId = 0; 9 if (point < 300) { tableId = 1000 + point % 15; 12 } else if (point < 800) { tableId = 2000 + point % 5; 15 } else { tableId = 3000 + point % 10; 18 } TopList.class.getSimpleName().toLowerCase() + tableId; 21 }
´´½¨±í
1 int points = 1200; 2 3 TopList topList = new TopList(); 4 for (int i = 1; i <= points; i++) { 5 topList.setDataTableName(getTableName(i)); sdi.createTable(topList); 8 }
±í×Ô¶¯´´½¨Íê³É£»
(int i = 1; i <= 50000; i++) { 3 long id = longId0.getId(); j = 1; 6 for (; j <= points; j++) { 7 8 TopList clone = (TopList) topList.clone(); 9 clone.setDataTableName(getTableName(j)); 10 clone.setPid(id); 11 clone.setTime(System.currentTimeMillis()); 12 clone.setPoint(j); 13 clone.setStar(3); clone.setIntegral(RandomUtils.random(20000, 400000)); 16 17 cudt.insert_Sync(clone); 18 } 19 log.info("×ܹ²Ð´ÈëÊý¾ÝÁ¿£º" + (i * (j - 1))); 20 Thread.sleep(1000); 21 }
дÈëËٶȣ¬ÒѾµÃµ½ÌáÉýÁË£¬
1 [07-25 14:24:12:293:DEBUG:CUDThread.run():219] ÐÂÔöÊý¾Ý²åÈëÓ°ÏìÐÐÊý£º3000 ºÄʱ£º2750 2 [07-25 14:24:12:294:DEBUG:CUDThread.run():246] µ±Ç°´ý´¦ÀíÊ£ÓàÊýÁ¿£º3600 3 [07-25 14:24:12:605:INFO :TopTest.main():68] ×ܹ²Ð´ÈëÊý¾ÝÁ¿£º222185 4 [07-25 14:24:13:619:INFO :TopTest.main():68] ×ܹ²Ð´ÈëÊý¾ÝÁ¿£º223386 5 [07-25 14:24:14:647:INFO :TopTest.main():68] ×ܹ²Ð´ÈëÊý¾ÝÁ¿£º224587 6 [07-25 14:24:14:757:DEBUG:CUDThread.run():219] ÐÂÔöÊý¾Ý²åÈëÓ°ÏìÐÐÊý£º3000 ºÄʱ£º2463 7 [07-25 14:24:14:758:DEBUG:CUDThread.run():246] µ±Ç°´ý´¦ÀíÊ£ÓàÊýÁ¿£º4200 8 [07-25 14:24:15:690:INFO :TopTest.main():68] ×ܹ²Ð´ÈëÊý¾ÝÁ¿£º225788 9 [07-25 14:24:16:709:INFO :TopTest.main():68] ×ܹ²Ð´ÈëÊý¾ÝÁ¿£º226989 10 [07-25 14:24:17:502:DEBUG:CUDThread.run():219] ÐÂÔöÊý¾Ý²åÈëÓ°ÏìÐÐÊý£º3000 ºÄʱ£º2744 11 [07-25 14:24:17:502:DEBUG:CUDThread.run():246] µ±Ç°´ý´¦ÀíÊ£ÓàÊýÁ¿£º3600 12 [07-25 14:24:17:743:INFO :TopTest.main():68] ×ܹ²Ð´ÈëÊý¾ÝÁ¿£º228190 13 [07-25 14:24:18:755:INFO :TopTest.main():68] ×ܹ²Ð´ÈëÊý¾ÝÁ¿£º229391 14 [07-25 14:24:19:783:INFO :TopTest.main():68] ×ܹ²Ð´ÈëÊý¾ÝÁ¿£º230592 15 [07-25 14:24:20:250:DEBUG:CUDThread.run():219] ÐÂÔöÊý¾Ý²åÈëÓ°ÏìÐÐÊý£º3000 ºÄʱ£º2748 16 [07-25 14:24:20:250:DEBUG:CUDThread.run():246] µ±Ç°´ý´¦ÀíÊ£ÓàÊýÁ¿£º4200 17 [07-25 14:24:20:824:INFO :TopTest.main():68] ×ܹ²Ð´ÈëÊý¾ÝÁ¿£º231793 18 [07-25 14:24:21:843:INFO :TopTest.main():68] ×ܹ²Ð´ÈëÊý¾ÝÁ¿£º232994
²éѯËÙ¶ÈÔÚµÚÈýÕÂÒѾÑéÖ¤ÁË£¬¾Í²»ÔÚÑéÖ¤£»
×ܽá
ÏñÏûÏûÀÖÕâÀàÐÍÓÎÏ·Öصã¾ÍÔÚÓÚÅÅÐаñÊý¾Ý´æ´¢ºÍ¶ÁÈ¡£¬È»ºóдÈëºÍ¶ÁÈ¡Ïà±È£¬Ð´ÈëµÄÐèÇóԶԶСÓÚ¶ÁÈ¡µÄÐèÇó£»
ÎÒ×öµÄÊÇʵʱÊý¾ÝÅÅÐаñÇø·Ö£»
µ±È»ÎÒÃÇ»¹¿ÉÒÔÀûÓÃmysqlµÄÖ÷´Ó¹Øϵ£¬Ìṩ¶Áд·ÖÀëÇé¿ö£¬×ö·ÇʵʱÅÅÐаñÊý¾Ý£»
Ò²¿ÉÒÔÀûÓ÷ǻ¬¶¯»º´æÀ´×ö·ÇʵʱÅÅÐаñ£¬½â¾öдÈëºÍ¶ÁÈ¡µÄÐÔÄÜƽºâÎÊÌ⣬»º´æ¿ÉÒÔÉèÖñÈÈçÿ5·ÖÖÓ»òÕßÿ10·ÖÖÓ¸üÐÂÒ»´ÎÅÅÐаñÊý¾ÝÀ´Íê³É£»
ÒÔÉÏ·ÖÎö¾Í²»ÔÙ×ö´úÂë²âÊÔ£»
ÕâÊÇÎÒ·ÖÎöºÍÎҵĽâ¾ö·½°¸£¬²»ÖªµÀŒÅ´óµÄÔ°ÓÑÃÇ»¹Òª¸üºÃµÄ½â¾ö·½°¸Âð£¿
¡¡