{"id":186,"date":"2013-06-06T15:59:50","date_gmt":"2013-06-06T07:59:50","guid":{"rendered":"http:\/\/www.gpfeng.com\/?p=186"},"modified":"2013-08-23T23:00:15","modified_gmt":"2013-08-23T15:00:15","slug":"innodb-vs-tokudb-%e6%8f%92%e5%85%a5%e6%80%a7%e8%83%bd%e6%9f%a5%e6%b5%8b%e8%af%95","status":"publish","type":"post","link":"http:\/\/www.gpfeng.com\/?p=186","title":{"rendered":"InnoDB vs. TokuDB \u5199\u5165\u6027\u80fd\u6d4b\u8bd5"},"content":{"rendered":"<h3>\u5e94\u7528\u573a\u666f\uff1a<\/h3>\n<p>\u9891\u7e41\u63d2\u5165\/\u5220\u9664\u4e00\u4e2a\u8868\u4e2d\u7684\u6570\u636e\uff0c\u6ca1\u6709\u67e5\u8be2\uff0c\u9700\u8981\u8bc4\u4f30InnoDB vs. TokuDB\u63d2\u5165\u6027\u80fd<\/p>\n<p>TokuDB\u5728\u5f00\u6e90\u540e\u83b7\u5f97\u4e86\u5927\u91cf\u5173\u6ce8\uff0c\u5176\u91c7\u7528\u7684fractal tree\u76f8\u5bf9\u4e8eb+tree\u6709\u7740\u5f88\u597d\u7684\u968f\u673a\u63d2\u5165\u6027\u80fd\uff0c\u800c\u67e5\u8be2\u6027\u80fd\u4e5f\u4e0d\u4f4e\uff0c<a href=\"http:\/\/cdn.oreillystatic.com\/en\/assets\/1\/event\/36\/How%20TokuDB%20Fractal%20Tree%20Databases%20Work%20Presentation.pdf\">How TokuDB Tree Indexes Work<\/a>\u4e2d\u4ecb\u7ecd\u4e86\u5176\u57fa\u672c\u539f\u7406\u548c\u7406\u8bba\u6027\u80fd\u516c\u5f0f\uff0c\u611f\u5174\u8da3\u53ef\u4ee5\u9605\u8bfb\uff0c\u672c\u6587\u5c06\u91cd\u70b9focus\u5728\u6027\u80fd\u6570\u636e\u4e0a\u3002<\/p>\n<h3>\u7248\u672c\u4fe1\u606f<\/h3>\n<pre lang=\"mysql\">\r\nmysql> select @@version;\r\n+-------------------------+\r\n| @@version               |\r\n+-------------------------+\r\n| 5.5.30-tokudb-7.0.1-log |\r\n+-------------------------+\r\n1 row in set (0.00 sec)\r\n<\/pre>\n<h3>\u6d4b\u8bd5\u573a\u666f\uff08\u4e00\uff09<\/h3>\n<p>n\u4e2a\u7ebf\u7a0b\u5e76\u53d1\u63d2\u5165total_records\u6761\u8bb0\u5f55<br \/>\n<!--more--><\/p>\n<h4>a) \u8868\u5b9a\u4e49\uff1a<\/h4>\n<pre lang=\"mysql\">\r\nCREATE TABLE `insert_test` (\r\n  `id` int(11) NOT NULL AUTO_INCREMENT,\r\n  `a` int(11) DEFAULT NULL,\r\n  `b` int(11) DEFAULT NULL,\r\n  `c` varchar(128) DEFAULT NULL,\r\n  PRIMARY KEY (`id`),\r\n  UNIQUE KEY `uniq_idx_bac` (`b`,`a`,`c`)\r\n)\r\n<\/pre>\n<h4>b) \u6570\u636e\u751f\u6210<\/h4>\n<pre lang=\"mysql\">\r\nb = rand()\r\na = thread_id + n*k \r\nc = random_string(128)\r\nPS: thread_id=[1..n], k=[0..total_records\/n]\r\n<\/pre>\n<h4>c) \u914d\u7f6emy.cnf\uff1a<\/h4>\n<p> > TokuDB\uff1a\u9ed8\u8ba4\u914d\u7f6e<\/p>\n<p> > InnoDB\uff1a<\/p>\n<pre lang=\"mysql\">\r\ninnodb_flush_method = O_DIRECT\r\ninnodb_file_per_table = 1\r\ninnodb_flush_log_at_trx_commit = 2\r\ninnodb_lock_wait_timeout = 100\r\ninnodb_additional_mem_pool_size = 20M\r\ninnodb_buffer_pool_size = 3G\r\ninnodb_log_buffer_size= 64M\r\ninnodb_log_file_size = 128M\r\ninnodb_log_files_in_group = 4\r\ninnodb_max_dirty_pages_pct = 75\r\n<\/pre>\n<h4>d) \u6d4b\u8bd5\u7ed3\u679c\uff1a<\/h4>\n<div class=\"table-responsive\"><table  style=\"width:400px; \"  class=\"easy-table easy-table-default \" border=\"0\">\n<caption>InnoDB vs. TokuDB insertion test 1<\/caption>\n<thead>\r\n<tr><th  style=\"text-align:center\" >threads<\/th>\n<th  style=\"text-align:center\" >db type<\/th>\n<th  style=\"text-align:right\" >rows inserted<\/th>\n<th  style=\"text-align:right\" >time(s)<\/th>\n<th  style=\"text-align:right\" >data size<\/th>\n<\/tr>\n<\/thead>\n<tbody>\r\n<tr><td  style=\"text-align:center\" >1<\/td>\n<td  style=\"text-align:center\" >innodb<\/td>\n<td  style=\"text-align:right\" >10000<\/td>\n<td  style=\"text-align:right\" >0.99<\/td>\n<td  style=\"text-align:right\" >14M<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >1<\/td>\n<td  style=\"text-align:center\" >tokudb<\/td>\n<td  style=\"text-align:right\" >10000<\/td>\n<td  style=\"text-align:right\" >6.27<\/td>\n<td  style=\"text-align:right\" >132K<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >1<\/td>\n<td  style=\"text-align:center\" >innodb<\/td>\n<td  style=\"text-align:right\" >100000<\/td>\n<td  style=\"text-align:right\" >9.61<\/td>\n<td  style=\"text-align:right\" >53M<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >1<\/td>\n<td  style=\"text-align:center\" >tokudb<\/td>\n<td  style=\"text-align:right\" >100000<\/td>\n<td  style=\"text-align:right\" >63.51<\/td>\n<td  style=\"text-align:right\" >8.2M<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >1<\/td>\n<td  style=\"text-align:center\" >innodb<\/td>\n<td  style=\"text-align:right\" >1000000<\/td>\n<td  style=\"text-align:right\" >97.49<\/td>\n<td  style=\"text-align:right\" >421M<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >1<\/td>\n<td  style=\"text-align:center\" >tokudb<\/td>\n<td  style=\"text-align:right\" >1000000<\/td>\n<td  style=\"text-align:right\" >663.33<\/td>\n<td  style=\"text-align:right\" >225M<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >1<\/td>\n<td  style=\"text-align:center\" >innodb<\/td>\n<td  style=\"text-align:right\" >10000000<\/td>\n<td  style=\"text-align:right\" >1689.59<\/td>\n<td  style=\"text-align:right\" >4.1G<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >1<\/td>\n<td  style=\"text-align:center\" >tokudb<\/td>\n<td  style=\"text-align:right\" >10000000<\/td>\n<td  style=\"text-align:right\" >6941.54<\/td>\n<td  style=\"text-align:right\" >2.7G<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >4<\/td>\n<td  style=\"text-align:center\" >innodb<\/td>\n<td  style=\"text-align:right\" >10000<\/td>\n<td  style=\"text-align:right\" >0.53<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >4<\/td>\n<td  style=\"text-align:center\" >tokudb<\/td>\n<td  style=\"text-align:right\" >10000<\/td>\n<td  style=\"text-align:right\" >3.04<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >4<\/td>\n<td  style=\"text-align:center\" >innodb<\/td>\n<td  style=\"text-align:right\" >100000<\/td>\n<td  style=\"text-align:right\" >4.84<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >4<\/td>\n<td  style=\"text-align:center\" >tokudb<\/td>\n<td  style=\"text-align:right\" >100000<\/td>\n<td  style=\"text-align:right\" >31.07<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >4<\/td>\n<td  style=\"text-align:center\" >innodb<\/td>\n<td  style=\"text-align:right\" >1000000<\/td>\n<td  style=\"text-align:right\" >48.79<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >4<\/td>\n<td  style=\"text-align:center\" >tokudb<\/td>\n<td  style=\"text-align:right\" >1000000<\/td>\n<td  style=\"text-align:right\" >318.02<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >4<\/td>\n<td  style=\"text-align:center\" >innodb<\/td>\n<td  style=\"text-align:right\" >10000000<\/td>\n<td  style=\"text-align:right\" >568.05<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >4<\/td>\n<td  style=\"text-align:center\" >tokudb<\/td>\n<td  style=\"text-align:right\" >10000000<\/td>\n<td  style=\"text-align:right\" >3267.52<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >32<\/td>\n<td  style=\"text-align:center\" >innodb<\/td>\n<td  style=\"text-align:right\" >10000<\/td>\n<td  style=\"text-align:right\" >0.58<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >32<\/td>\n<td  style=\"text-align:center\" >tokudb<\/td>\n<td  style=\"text-align:right\" >10000<\/td>\n<td  style=\"text-align:right\" >1.06<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >32<\/td>\n<td  style=\"text-align:center\" >innodb<\/td>\n<td  style=\"text-align:right\" >100000<\/td>\n<td  style=\"text-align:right\" >5.72<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >32<\/td>\n<td  style=\"text-align:center\" >tokudb<\/td>\n<td  style=\"text-align:right\" >100000<\/td>\n<td  style=\"text-align:right\" >10.65<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >32<\/td>\n<td  style=\"text-align:center\" >innodb<\/td>\n<td  style=\"text-align:right\" >1000000<\/td>\n<td  style=\"text-align:right\" >58.47<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >32<\/td>\n<td  style=\"text-align:center\" >tokudb<\/td>\n<td  style=\"text-align:right\" >1000000<\/td>\n<td  style=\"text-align:right\" >106.41<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >32<\/td>\n<td  style=\"text-align:center\" >innodb<\/td>\n<td  style=\"text-align:right\" >10000000<\/td>\n<td  style=\"text-align:right\" >633.58<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n\r\n<tr><td  style=\"text-align:center\" >32<\/td>\n<td  style=\"text-align:center\" >tokudb<\/td>\n<td  style=\"text-align:right\" >10000000<\/td>\n<td  style=\"text-align:right\" >1120.16<\/td>\n<td  style=\"text-align:right\" >- &#8211;<\/td>\n<\/tr>\n<\/tbody><\/table><\/div>\n<h4>e) \u57fa\u672c\u7ed3\u8bba:<\/h4>\n<p>1. \u5728\u8be5\u573a\u666f\u4e0b\uff0cInnoDB\u662f\u6309\u7167\u4e3b\u952e\u81ea\u589e\u7684\u987a\u5e8f\u63d2\u5165\u8bb0\u5f55\u7684\uff0c\u540c\u65f6\u7ef4\u62a4\u4e00\u4e2a\u4e8c\u7ea7\u7d22\u5f15\uff08\u5f15\u5165\u4e86\u968f\u673aIO\uff09\uff0cTokuDB\u7684\u63d2\u5165\u6027\u80fd\u843d\u540e\u4e8eInnoDB\uff08\u5bf9\u4e8eB+tree\u800c\u8a00\uff0c3\u5c42\uff09<br \/>\n2. TokuDB\u6709\u7740\u8f83\u597d\u7684\u6570\u636e\u538b\u7f29\u7387\uff0c\u5b98\u65b9\u5ba3\u79f0\u76842~4\u500d\u4e8eInnoDB\u7684\u7ed3\u8bba\u57fa\u672c\u6210\u7acb<\/p>\n<h4>f) \u5206\u6790<\/h4>\n<p>B+tree\u80fd\u591f\u63d0\u4f9b\u8f83\u597d\u7684\u67e5\u8be2\u6027\u80fd\u662f\u56e0\u4e3a\u5176\u8f83\u9ad8\u7684\u6247\u51fa\uff0c\u901a\u5e38\u6765\u8bf4\uff0cInnoDB\u4e2d\u5343\u4e07\u7ea7\u522b\u8bb0\u5f55\u6570\u7684\u8868\u53ea\u9700\u8981\u4e00\u98973\u5c42\u7684B+tree\u5c31\u53ef\u4ee5\u4fdd\u5b58\uff08\u4e00\u4e2a\u9875\u976216KB\uff0c\u975e\u53f6\u5b50\u8282\u70b9\u4e00\u4e2aIndex entry\u5927\u6982\u6570\u5341Byte\uff0c\u4e00\u4e2apage\u53ef\u4ee5\u5b58\u653e500~1000\u5de6\u53f3\u7684\u6307\u5411\u4e0b\u5c42\u9875\u9762\u7684\u6307\u9488\uff0c\u53f6\u5b50\u8282\u70b9\u4fdd\u5b58\u4e86\u5b8c\u6574\u6570\u636e\uff0c\u80fd\u591f\u5b58\u653e\u7684\u8bb0\u5f55\u6570\u8f83\u5c11\uff0c\u6309\u7167\u4e00\u6761\u8bb0\u5f55\u5927\u7ea6\u5360\u7528200 bytes\u6765\u7b97\uff0c\u4e00\u4e2apage\u53ef\u4ee5\u5b58\u653e80\u6761\u8bb0\u5f55\uff0c\u56e0\u6b64\u4e00\u9897\u4e09\u5c42\u7684B+tree\u53ef\u4ee5\u5b58\u653e\u7684\u8bb0\u5f55\u662f\uff1a500*500*80=2kw\uff0c\u5982\u679c\u4e3b\u952e\u80fd\u591f\u66f4\u77ed\u7684\u8bdd\uff0c1000*1000*80=8kw\uff0c\u53ef\u4ee5\u53c2\u8003<a href=http:\/\/blog.jcole.us\/2013\/01\/10\/btree-index-structures-in-innodb\/>Jeremy Cole\u535a\u5ba2<\/a>\uff09\uff0c\u901a\u5e38\u7b2c\u4e00\u548c\u7b2c\u4e8c\u5c42\u975e\u53f6\u5b50\u8282\u70b9\u9875\u9762\u57fa\u672c\u5728\u5185\u5b58\u4e2d\uff0c\u56e0\u6b64\u4e00\u6b21\u67e5\u8be2\u6700\u591a\u4e00\u6b21IO\uff0c\u800c\u7531\u4e8eBuffer pool\u7684\u5b58\u5728\uff0c\u67e5\u8be2\u6027\u80fd\u8fdb\u4e00\u6b65\u5f97\u5230\u63d0\u5347<\/p>\n<p>\u672c\u6d4b\u8bd5\u63d2\u5165\u7684\u6700\u5927\u8bb0\u5f55\u657010000000\uff0c\u56e0\u6b64B+tree\u7684\u5c42\u6570(3)\u5176\u5b9e\u8fd8\u662f\u8f83\u5c11\u7684\uff0c\u63d2\u5165\u65f6\u95f4\u57fa\u672c\u4e0a\u968f\u63d2\u5165\u8bb0\u5f55\u968f\u5448\u7ebf\u6027\u589e\u957f\uff0cTokuDB\u5ba3\u79f0\u7684\u6bd4InnoDB\u66f4\u597d\u7684\u63d2\u5165\u6027\u80fd\u5e94\u8be5\u662f\u5728\u66f4\u5927\u7684\u8bb0\u5f55\u6570\u7684\u524d\u63d0\u4e0a\uff0c\u6d4b\u8bd5\u4e8c\u5c06\u9a8c\u8bc1\u8fd9\u4e2a\u731c\u6d4b<\/p>\n<h3>\u6d4b\u8bd5\u573a\u666f\uff08\u4e8c\uff09<\/h3>\n<p>\u4e0e\u6d4b\u8bd5\uff08\u4e00\uff09\u4e0d\u540c\uff0c\u672c\u6b21\u6d4b\u8bd5\u4f7f\u7528<a href=http:\/\/bazaar.launchpad.net\/~mdcallag\/mysql-patch\/mytools\/annotate\/head%3A\/bench\/ibench\/iibench.py>iibench<\/a>\u5de5\u5177\uff0cpython\u7248\u672c\u51fa\u81ea\u5927\u725bMark Callaghan\uff0c\u6d4b\u8bd5\u4e2d\u5355\u7ebf\u7a0b\u63d2\u516531kw\u6761\u8bb0\u5f55\uff0c\u7edf\u8ba1\u6bcf\u63d2\u5165\u4e00\u5b9a\u6570\u76ee\u8bb0\u5f55\u6d88\u8017\u7684\u65f6\u95f4\u63d2\u5165\u65f6\u95f4\u6765\u8ba1\u7b97IPS(Insert Per Second)\uff0c\u5bf9\u6bd4InnoDB\u4e0eTokuDB\u7684\u6027\u80fd<\/p>\n<h4>a) \u5efa\u8868\u4fe1\u606f<\/h4>\n<pre lang=\"mysql\">\r\nCREATE TABLE `purchases_index` (\r\n  `transactionid` int(11) NOT NULL AUTO_INCREMENT,\r\n  `dateandtime` datetime DEFAULT NULL,\r\n  `cashregisterid` int(11) NOT NULL,\r\n  `customerid` int(11) NOT NULL,\r\n  `productid` int(11) NOT NULL,\r\n  `price` float NOT NULL,\r\n  `data` varchar(4000) DEFAULT NULL,\r\n  PRIMARY KEY (`transactionid`),\r\n  KEY `marketsegment` (`price`,`customerid`),\r\n  KEY `registersegment` (`cashregisterid`,`price`,`customerid`),\r\n  KEY `pdc` (`price`,`dateandtime`,`customerid`)\r\n);\r\n<\/pre>\n<h4>b) \u6d4b\u8bd5\u811a\u672c<\/h4>\n<pre lang=\"mysql\">\r\n.\/iibench.py --db_socket=mysql.sock --db_user=root --insert_only --setup --max_rows=310000000 --rows_per_commit=10 --tokudb_commit_sync=0 --engine=innodb\r\n.\/iibench.py --db_socket=mysql.sock --db_user=root --insert_only --setup --max_rows=310000000 --rows_per_commit=10 --tokudb_commit_sync=0 --engine=tokudb\r\n<\/pre>\n<p>\u6bcf\u4e2ainsert\u8bed\u53e5\u63d2\u516510\u6761\u8bb0\u5f55\uff0c\u6bcf\u63d2\u5165100w\u884c\u8bb0\u5f55report\u63d2\u5165\u65f6\u95f4\uff08\u7528\u4e8e\u8ba1\u7b97IPS\uff09\uff0c\u63d2\u5165\u65f6\u6309\u7167\u4e3b\u952e\u81ea\u589e\u7684\u987a\u5e8f\u63d2\u5165\uff0c\u540c\u65f6\u7ef4\u62a43\u4e2a\u4e8c\u7ea7\u7d22\u5f15\uff08\u968f\u673aIO\uff09<\/p>\n<h4>c) \u7ed3\u679c\u5bf9\u6bd4\u56fe\uff1a<\/h4>\n<p><a href=\"https:\/\/i0.wp.com\/www.gpfeng.com\/wp-content\/uploads\/2013\/06\/iibench_innodb_vs_tokudb1.jpg\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.gpfeng.com\/wp-content\/uploads\/2013\/06\/iibench_innodb_vs_tokudb1.jpg?w=660\" alt=\"iibench_innodb_vs_tokudb\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<h4>d) \u7ed3\u8bba<\/h4>\n<p>1. \u5728\u63d2\u5165\u6570\u636e\u91cf\u89c4\u6a21\u5728\u5927\u7ea63.1kw\u4e4b\u524d\uff0cInnoDB\u7684\u63d2\u5165\u6027\u80fd\u8981\u597d\u4e8eTokuDB\uff0c\u800c\u5728\u7ee7\u7eed\u63d2\u5165\u65f6\uff0cInnoDB\u63d2\u5165\u6027\u80fd\u4e0b\u964d\u5389\u5bb3<br \/>\n2. TokuDB\u63d2\u5165\u6027\u80fd\u4e00\u76f4\u5f88\u7a33\u5b9a\uff0c\u5728\u8868\u6570\u636e\u89c4\u6a21\u5f88\u5927\u65f6\u4e5f\u80fd\u4fdd\u6301\u63d2\u5165\u6027\u80fd\uff0c\u56e0\u800c\u5bf9\u4e8e\u8d85\u5927\u8868\uff08>=10kw\u7ea7\u522b\uff09\uff0cTokuDB\u8f83InnoDB\u6709\u8f83\u5927\u4f18\u52bf<br \/>\n3. \u7ebf\u4e0a\u5e94\u7528\u91c7\u53d6\u5206\u5e93\u5206\u8868\u7b56\u7565\uff0c\u5355\u8868\u5bb9\u91cf\u4e00\u822c\u4e0d\u8d85\u8fc7500w\u6761\u8bb0\u5f55\uff0c\u56e0\u6b64\u6b64\u65f6InnoDB\u8f83TokuDB\u6709\u4f18\u52bf<\/p>\n<h4>e) \u5206\u6790<\/h4>\n<p>\u53ef\u80fd\u539f\u56e0\uff1aInnoDB\u8868\u5728\u63d2\u5165\u57283.1kw\u4e4b\u540e\uff0c\u7d22\u5f15B+tree\u75313\u5c42\u53d8\u62104\u5c42\uff0c\u6bcf\u6b21\u968f\u673a\u63d2\u5165\u76f8\u5bf9\u4e8e3\u5c42\u7ed3\u6784\u4f1a\u589e\u52a0\u4e00\u6b21IO<\/p>\n<h4>f) my.cnf \u53c2\u6570<\/h4>\n<p> \u4e0e\u6d4b\u8bd5\uff08\u4e00\uff09\u4e2d\u76f8\u540c<\/p>\n<h4>g) \u8c03\u6574 innodb_buffer_pool_size = 8GB\uff0c\u6d4b\u8bd5\u589e\u5927buffer pool\u6548\u679c<\/h4>\n<p><a href=\"https:\/\/i0.wp.com\/www.gpfeng.com\/wp-content\/uploads\/2013\/06\/iibench_innodb_vs_tokudb2.jpg\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.gpfeng.com\/wp-content\/uploads\/2013\/06\/iibench_innodb_vs_tokudb2.jpg?w=660\" alt=\"iibench_innodb_vs_tokudb\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<h3>\u6d4b\u8bd5\u573a\u666f\uff08\u4e09\uff09<\/h3>\n<p>\u91c7\u7528load data infile\u65b9\u5f0f\u52a0\u8f7d\u6570\u636e\uff0c\u6570\u636e\u91cf5\u4ebf\u6761\uff0c\u6309\u7167\u4e3b\u952eID\u81ea\u589eload\u6570\u636e\uff0cload\u65f6\u4e0d\u7ef4\u62a4\u4efb\u4f55\u7d22\u5f15\uff0c\u7531\u4e8e\u6570\u636e\u91cf\uff08>200G\uff09\u8d85\u8fc7\u5185\u5b58\u5927\u5c0f\uff0c\u5c06\u6570\u636e\u6587\u4ef6\u5207\u5206\u6210100w\u6761\u4e00\u4e2a \u7136\u540e\u4e00\u4e2a\u6587\u4ef6\u4e00\u4e2a\u6587\u4ef6load<br \/>\n\u7edf\u8ba1\u6bcf\u4e2a\u6587\u4ef6load\u5b8c\u6210\u7684\u65f6\u95f4 \u6839\u636eload\u7684\u603b\u6761\u6570\/load\u65f6\u95f4 \u8ba1\u7b97\u6bcf\u5bfc\u5165100w\u6761\u8bb0\u5f55\u7684\u901f\u5ea6<\/p>\n<h4>a) \u8868\u6a21\u5f0f<\/h4>\n<pre lang=\"mysql\">\r\ntable_struct='(\r\n  `transactionid` int(11) NOT NULL AUTO_INCREMENT,\r\n  `dateandtime` datetime DEFAULT NULL,\r\n  `cashregisterid` int(11) NOT NULL,\r\n  `customerid` int(11) NOT NULL,\r\n  `productid` int(11) NOT NULL,\r\n  `price` float NOT NULL,\r\n  `data` varchar(400) DEFAULT NULL,\r\n  PRIMARY KEY (`transactionid`)\r\n)'\r\n<\/pre>\n<h4>b) \u53c2\u6570\u914d\u7f6e<\/h4>\n<p>innodb_buffer_pool_size = 8GB<br \/>\n\u5176\u5b83\u914d\u7f6e\u4e0e\u6d4b\u8bd5(\u4e00)\u4e2d\u76f8\u540c<\/p>\n<h4>c) \u6027\u80fd\u7ed3\u679c\u56fe<\/h4>\n<p><a href=\"https:\/\/i0.wp.com\/www.gpfeng.com\/wp-content\/uploads\/2013\/07\/load_innodb_vs_tokudb.jpg\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.gpfeng.com\/wp-content\/uploads\/2013\/07\/load_innodb_vs_tokudb.jpg?w=660\" alt=\"load_innodb_vs_tokudb\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<h4>d) \u5206\u6790<\/h4>\n<p>1. InnoDB\u4e2dbtree\u5728\u987a\u5e8f\u5199\u5165\u65b9\u9762\uff0c\u7531\u4e8e\u5e26\u6765\u7684\u968f\u673aIO\u8f83\u5c11\u7684\u7f18\u6545\uff0c\u5199\u5165\u6027\u80fd\u80fd\u591f\u4e00\u76f4\u4fdd\u6301\u8f83\u9ad8\u7684\u6c34\u5e73\uff0c\u6d4b\u8bd5\u7ed3\u679c\u663e\u793a\u6bd4TokuDB\u597d<br \/>\n2. \u987a\u5e8f\u5199\u5165InnoDB\u548cTokuDB\u5199\u5165\u6027\u80fd\u90fd\u5f88\u7a33\u5b9a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5e94\u7528\u573a\u666f\uff1a \u9891\u7e41\u63d2\u5165\/\u5220\u9664\u4e00\u4e2a\u8868\u4e2d\u7684\u6570\u636e\uff0c\u6ca1\u6709\u67e5\u8be2\uff0c\u9700\u8981\u8bc4\u4f30InnoDB vs. TokuDB\u63d2\u5165\u6027\u80fd Tok &hellip; <a href=\"http:\/\/www.gpfeng.com\/?p=186\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">InnoDB vs. TokuDB \u5199\u5165\u6027\u80fd\u6d4b\u8bd5<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[1],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3tPZp-30","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/www.gpfeng.com\/index.php?rest_route=\/wp\/v2\/posts\/186"}],"collection":[{"href":"http:\/\/www.gpfeng.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gpfeng.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gpfeng.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gpfeng.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=186"}],"version-history":[{"count":43,"href":"http:\/\/www.gpfeng.com\/index.php?rest_route=\/wp\/v2\/posts\/186\/revisions"}],"predecessor-version":[{"id":397,"href":"http:\/\/www.gpfeng.com\/index.php?rest_route=\/wp\/v2\/posts\/186\/revisions\/397"}],"wp:attachment":[{"href":"http:\/\/www.gpfeng.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gpfeng.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=186"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gpfeng.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}