| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> mysql >> MySQL shu ju ku dan yi biao tu po 4G xian zhi de shi xian fang fa

MySQL shu ju ku dan yi biao tu po 4G xian zhi de shi xian fang fa

2008-08-19 06:50:57 编辑來源:互联网 评论
 
 
 
本文为【MySQL数据库单一表突破4G限制的实现方法】的拼音翻译版
  wen ti : zai lun tan fa biao hui fu shi chu xian “The table is full” de ti shi , zi mian yi yi shang shi shu ju biao yi man de yi si 。 yin wei hen shao you kai fa zhe zao yu dan yi biao chao guo 4G de qing kuang , yin ci peng you jian de tao lun zhi neng ti gong yi xie wai wei de xin xi 。 wei jie jue ci wen ti , wo fan yue le hen duo zi liao , ben wen jiang yi wo ci ci wen ti de jie jue guo cheng , jie shao wen ti fa sheng de yuan yin ji dui ce 。
  gen ju jing yan ,The table is full ti shi wang wang chu xian zai yi xia liang zhong qing kuang :
  1. biao zhong she zhi le MAX_ROWS zhi , jian dan de shuo , ruo MAX_ROWS she zhi wei 100, er cheng xu shi tu xie ru di 101 tiao ji lu , hui chu xian ci cuo wu 。
  2. biao man 。 zhe zhong qing kuang shi ben wen tao lun de chong dian
  wo men ren wei MySQL zai cun qu biao de shi hou , cun zai yi zhong ding wei fen pei gui lv 。 zhe ge gui lv zai mo ren de qing kuang xia , ke yi xun zhi 4G yi nei de shu ju 。 chao guo zhe ge da xiao , shu ju ku jiang bu neng dui shu ju ding wei , yin er ye wu fa jin xing du xie 。 jing guo shi yan , zhe ge xian zhi shi wan quan ke yi bei tu po de 。
  ben li zhong , yong hu de xi tong huan jing wei shuang Athlon chu li qi 、SCSI ying pan 72G、2G nei cun , yong hu de tie zi biao shu ju chi cun wei 4294963640, jie jin 4G(4G de shi ji zi jie shu wei 4294967296)。
  shou xian SSH deng lu hou , cha kan yong hu de xi tong xin xi :
  # uname -a
  Linux zichen.com 2.4.20-8smp #1 SMP Thu Mar 13 16:43:01 EST 2003 i686 athlon i386 GNU/Linux
  zheng ming shi Linux xi tong , gen ju nei gai ban ben 2.4.20-8smp, jia shang guo nei shi yong de chang jian xi tong , gu ji ying gai shi redhat 9 fa xing bao 。
  # cat /etc/*release*
  Red Hat Linux release 9 (Shrike)
  zhe ye zheng ming le wo men dui xi tong ban ben de cai xiang 。
  ran hou kan yi xia yong de shi shen me wen jian xi tong 。 yin wei gai yong hu bing fei gao shou , gu ji zai zhuang xi tong de shi hou jiu shi yi lu hui che xia lai ,redhat 9 mo ren de ying gai shi EXT3, bu guo wo men huan shi kan yi xia :
  # parted
  GNU Parted 1.6.3
  Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
  This program is free software, covered by the GNU General Public License.
  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  Using /dev/sda
  Information: The operating system thinks the geometry on /dev/sda is 8942/255/63. Therefore, cylinder 1024 ends at 8032.499M.
  (parted) print
  Disk geometry for /dev/sda: 0.000-70149.507 megabytes
  Disk label type: msdos
  Minor Start End Type Filesystem Flags
  1 0.031 101.975 primary ext3 boot
  2 101.975 10103.378 primary linux-swap
  zheng ming que shi shi zhe yang zi 。 sui hou wo men fan yue le EXT3 wen jian xi tong de xiang guan ji shu shen shu ,EXT3 shi zai EXT2 ji chu shang yan bian er lai 。EXT2 suo zhi chi zui da dan yi wen jian chang du shi 2G, zhe ge shi hen bie jiao de yi ge xian zhi 。EXT3 zuo de hen da yi ge gai shan jiu shi jiang zhe ge xian zhi fang da dao le 2TB, you ci shao song yi kou qi , qi ma bu shi cao zuo xi tong shang de xian zhi 。
  jing guo peng you de kai dao , le jie dao dan yi wen jian da xiao you ru xia ji ge yin su :
  1. wen jian xi tong de xian zhi ( ru gang cun suo shuo EXT3 de 2TB xian zhi )
  2. mou yi cheng xu jin cheng suo neng cun qu de di yi wen jian zui da chi cun ( li ru apache zai Linux EXT3 xia neng cun qu de zui da chi cun wei 2G, zhu ru ri zhi )
  chu bu pan duan ping jing jiu zai shang shu qi zhong di er xiang 。 sui hou zhao dao myisamchk lai xian shi yi xia biao xin xi , zheng ming le ping jing jiu zai MySQL ben shen de cun qu shang 。
  # myisamchk -dv cdb_posts
  jie guo jiu bu tie le , qi zhong you yi xiang Max datafile length de zhi qia hao jiu shi 4G。 you ci chan sheng le ping jing 。
  hou lai fan yue le N duo zi liao , jin xing le N duo chang shi , ye zou le bu shao wan lu , zui zhong jiao de huan shi guan fang wen dang bi jiao ke kao 。 bi jiao lao de wen dang li xie dao zhe shi you yu tmp_table_size de zhi zao cheng de , ye you ti dao yong BIG-TABLES zhe ge shen shu 。 shi shi zheng ming zhe xie dou shi qi tu 。 da wan shang de que shi hen lei , zhe li zhi gei chu zui zhong de jie jue fang an ba , zhong jian de jiu bu luo suo le 。
  jin dao mysql ke hu duan 。
  # mysql -uroot -p
  Enter password: ******
  Welcome to the MySQL monitor. Commands end with ; or \g.
  Your MySQL connection id is 59411 to server version: 4.0.18-standard
  Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
  mysql> use ******
  Database changed
  mysql> ALTER TABLE cdb_posts MAX_ROWS=1000000000 AVG_ROW_LENGTH=15000;
  yin wei zhe ge biao fei chang da , zhi xing shi jian zai shuang Athlon de zhuan ye fu wu qi shang jing ran hua le 30 fen zhong !
  zhi hou zai tong guo myisamchk cha kan gai biao de xin xi :
  # myisamchk -dv cdb_posts
  MyISAM file: cdb_posts
  Record format: Packed
  Character set: latin1 (8)
  File-version: 1
  Creation time: 2004-08-30 22:19:48
  Recover time: 2004-08-30 22:42:47
  Status: open,changed
  Auto increment key: 1 Last value: 1063143
  Data records: 619904 Deleted blocks: 5
  Datafile parts: 619909 Deleted data: 323872
  Datafile pointer (bytes): 6 Keyfile pointer (bytes): 4
  Datafile length: 4295287332 Keyfile length: 40421376
  Max datafile length: 281474976710654 Max keyfile length: 4398046510079
  Recordlength: 149
  table description:
  Key Start Len Index Type Rec/key Root Blocksize
  1 1 4 unique unsigned long 1 4535296 1024
  2 5 2 multip. unsigned short 13776 12540928 1024
  3 111 4 multip. unsigned long 1 18854912 1024
  4 28 3 multip. uint24 18 24546304 1024
  5 7 3 multip. uint24 7 32827392 1024
  111 4 unsigned long 1
  6 7 3 multip. uint24 7 40418304 1024
  28 3 uint24
  ling ren zhen fen de shi qing fa sheng le , gai biao de Max datafile length: 281474976710654 Max keyfile length: 4398046510079, ji zui da shu ju chi cun (MYD wen jian ) da dao le 2TB, zui da suo yin chi cun (MYI) reng ran wei 4G。
  you ci mo ren de 4G xian zhi bei tu po le 。 guan yu qi zhong de yuan li , qi shi hen jian dan : jia she ni you yi ge ri ji ben , shang mian you 10 ye zhi ke yi xie dong xi , bian pai mu lu zhi xu yao 1 ge zi jie ( yin wei 0~9 jiu gou le )。 ru guo ni ba zhe ben zi you sai jin liang zhang zhi , bian cheng 12 ye ,1 ge zi jie de mu lu kong jian jiu wu fa xun zhi dao hou mian de liang ye zhong , jin er chan sheng le cuo wu 。 shang mian na ge ALTER yu ju zhong de shu zhi dou shi wo wei bao zheng cheng gong , qu de bi jiao da de zhi ( yin wei ALTER yi ci shi zai shi tai man le , mei shi jian zai na luan shi yan ), xiang dang yu gao su shu ju ku , zhe ge ben zi you 1000000000 ye , mei ye ping yun you 15000 ge zi jie 。 zhe yang shu ju ku bian zhi dao zhe shi hen da de yi ge ben zi , yin ci bu yi yu li de na chu le 100 ye ( jia she shuo ) zuo mu lu bian pai , zhe yang zhe ge xin de mu lu jiu ke yi xun zhi dao ri ji ben de suo you nei rong le 。 cuo wu xiao shi 。
  wei yi de que dian jiu shi , mu lu zhan yong de kong jian duo le yi xie , dan yi jing wei hu qi wei le , zuo le zhe zhong gai bian qi shi 4G de wen jian chi cun da xiao zhi zeng da le 1M duo , fei chang ling ren zhen fen 。【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
wen ti : zai lun tan fa biao hui fu shi chu xian “The table is full” de ti shi , zi mian yi yi shang shi shu ju biao yi man de yi si 。 yin wei hen shao you kai fa zhe zao yu dan yi biao chao guo 4G de qing kuang , yin ci peng you jian de tao lun zhi neng ti gong yi xie wai wei de xin xi 。 wei jie jue ci wen ti , wo fan yue le hen duo zi liao , ben wen jiang yi wo ci ci wen ti de jie jue guo cheng , jie shao wen ti fa sheng de yuan yin ji dui ce 。 gen ju jing yan ,The table is full ti shi wang wang chu xian zai yi xia liang zhong qing kuang : 1. biao zhong she zhi le MAX_ROWS zhi , jian dan de shuo , ruo MAX_ROWS she zhi wei 100, er cheng xu shi tu xie ru di 101 tiao ji lu , hui chu xian ci cuo wu 。 2. biao man 。 zhe zhong qing kuang shi ben wen tao lun de chong dian wo men ren wei MySQL zai cun qu biao de shi hou , cun zai yi zhong ding wei fen pei gui lv 。 zhe ge gui lv zai mo ren de qing kuang xia , ke yi xun zhi 4G yi nei de shu ju 。 chao guo zhe ge da xiao , shu ju ku jiang bu neng dui shu ju ding wei , yin er ye wu fa jin xing du xie 。 jing guo shi yan , zhe ge xian zhi shi wan quan ke yi bei tu po de 。 ben li zhong , yong hu de xi tong huan jing wei shuang Athlon chu li qi 、SCSI ying pan 72G、2G nei cun , yong hu de tie zi biao shu ju chi cun wei 4294963640, jie jin 4G(4G de shi ji zi jie shu wei 4294967296)。 shou xian SSH deng lu hou , cha kan yong hu de xi tong xin xi : # uname -a Linux zichen.com 2.4.20-8smp #1 SMP Thu Mar 13 16:43:01 EST 2003 i686 athlon i386 GNU/Linux zheng ming shi Linux xi tong , gen ju nei gai ban ben 2.4.20-8smp, jia shang guo nei shi yong de chang jian xi tong , gu ji ying gai shi redhat 9 fa xing bao 。 # cat /etc/*release* Red Hat Linux release 9 (Shrike) zhe ye zheng ming le wo men dui xi tong ban ben de cai xiang 。 ran hou kan yi xia yong de shi shen me wen jian xi tong 。 yin wei gai yong hu bing fei gao shou , gu ji zai zhuang xi tong de shi hou jiu shi yi lu hui che xia lai ,redhat 9 mo ren de ying gai shi EXT3, bu guo wo men huan shi kan yi xia : # parted GNU Parted 1.6.3 Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software, covered by the GNU General Public License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Using /dev/sda Information: The operating system thinks the geometry on /dev/sda is 8942/255/63. Therefore, cylinder 1024 ends at 8032.499M. (parted) print Disk geometry for /dev/sda: 0.000-70149.507 megabytes Disk label type: msdos Minor Start End Type Filesystem Flags 1 0.031 101.975 primary ext3 boot 2 101.975 10103.378 primary linux-swap zheng ming que shi shi zhe yang zi 。 sui hou wo men fan yue le EXT3 wen jian xi tong de xiang guan ji shu shen shu ,EXT3 shi zai EXT2 ji chu shang yan bian er lai 。EXT2 suo zhi chi zui da dan yi wen jian chang du shi 2G, zhe ge shi hen bie jiao de yi ge xian zhi 。EXT3 zuo de hen da yi ge gai shan jiu shi jiang zhe ge xian zhi fang da dao le 2TB, you ci shao song yi kou qi , qi ma bu shi cao zuo xi tong shang de xian zhi 。 jing guo peng you de kai dao , le jie dao dan yi wen jian da xiao you ru xia ji ge yin su : 1. wen jian xi tong de xian zhi ( ru gang cun suo shuo EXT3 de 2TB xian zhi ) 2. mou yi cheng xu jin cheng suo neng cun qu de di yi wen jian zui da chi cun ( li ru apache zai Linux EXT3 xia neng cun qu de zui da chi cun wei 2G, zhu ru ri zhi ) chu bu pan duan ping jing jiu zai shang shu qi zhong di er xiang 。 sui hou zhao dao myisamchk lai xian shi yi xia biao xin xi , zheng ming le ping jing jiu zai MySQL ben shen de cun qu shang 。 # myisamchk -dv cdb_posts jie guo jiu bu tie le , qi zhong you yi xiang Max datafile length de zhi qia hao jiu shi 4G。 you ci chan sheng le ping jing 。 hou lai fan yue le N duo zi liao , jin xing le N duo chang shi , ye zou le bu shao wan lu , zui zhong jiao de huan shi guan fang wen dang bi jiao ke kao 。 bi jiao lao de wen dang li xie dao zhe shi you yu tmp_table_size de zhi zao cheng de , ye you ti dao yong BIG-TABLES zhe ge shen shu 。 shi shi zheng ming zhe xie dou shi qi tu 。 da wan shang de que shi hen lei , zhe li zhi gei chu zui zhong de jie jue fang an ba , zhong jian de jiu bu luo suo le 。 jin dao mysql ke hu duan 。 # mysql -uroot -p Enter password: ****** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 59411 to server version: 4.0.18-standard Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use ****** Database changed mysql> ALTER TABLE cdb_posts MAX_ROWS=1000000000 AVG_ROW_LENGTH=15000; yin wei zhe ge biao fei chang da , zhi xing shi jian zai shuang Athlon de zhuan ye fu wu qi shang jing ran hua le 30 fen zhong ! zhi hou zai tong guo myisamchk cha kan gai biao de xin xi : # myisamchk -dv cdb_posts MyISAM file: cdb_posts Record format: Packed Character set: latin1 (8) File-version: 1 Creation time: 2004-08-30 22:19:48 Recover time: 2004-08-30 22:42:47 Status: open,changed Auto increment key: 1 Last value: 1063143 Data records: 619904 Deleted blocks: 5 Datafile parts: 619909 Deleted data: 323872 Datafile pointer (bytes): 6 Keyfile pointer (bytes): 4 Datafile length: 4295287332 Keyfile length: 40421376 Max datafile length: 281474976710654 Max keyfile length: 4398046510079 Recordlength: 149 table description: Key Start Len Index Type Rec/key Root Blocksize 1 1 4 unique unsigned long 1 4535296 1024 2 5 2 multip. unsigned short 13776 12540928 1024 3 111 4 multip. unsigned long 1 18854912 1024 4 28 3 multip. uint24 18 24546304 1024 5 7 3 multip. uint24 7 32827392 1024 111 4 unsigned long 1 6 7 3 multip. uint24 7 40418304 1024 28 3 uint24 ling ren zhen fen de shi qing fa sheng le , gai biao de Max datafile length: 281474976710654 Max keyfile length: 4398046510079, ji zui da shu ju chi cun (MYD wen jian ) da dao le 2TB, zui da suo yin chi cun (MYI) reng ran wei 4G。 you ci mo ren de 4G xian zhi bei tu po le 。 guan yu qi zhong de yuan li , qi shi hen jian dan : jia she ni you yi ge ri ji ben , shang mian you 10 ye zhi ke yi xie dong xi , bian pai mu lu zhi xu yao 1 ge zi jie ( yin wei 0~9 jiu gou le )。 ru guo ni ba zhe ben zi you sai jin liang zhang zhi , bian cheng 12 ye ,1 ge zi jie de mu lu kong jian jiu wu fa xun zhi dao hou mian de liang ye zhong , jin er chan sheng le cuo wu 。 shang mian na ge ALTER yu ju zhong de shu zhi dou shi wo wei bao zheng cheng gong , qu de bi jiao da de zhi ( yin wei ALTER yi ci shi zai shi tai man le , mei shi jian zai na luan shi yan ), xiang dang yu gao su shu ju ku , zhe ge ben zi you 1000000000 ye , mei ye ping yun you 15000 ge zi jie 。 zhe yang shu ju ku bian zhi dao zhe shi hen da de yi ge ben zi , yin ci bu yi yu li de na chu le 100 ye ( jia she shuo ) zuo mu lu bian pai , zhe yang zhe ge xin de mu lu jiu ke yi xun zhi dao ri ji ben de suo you nei rong le 。 cuo wu xiao shi 。 wei yi de que dian jiu shi , mu lu zhan yong de kong jian duo le yi xie , dan yi jing wei hu qi wei le , zuo le zhe zhong gai bian qi shi 4G de wen jian chi cun da xiao zhi zeng da le 1M duo , fei chang ling ren zhen fen 。
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
玉美人_珠联璧合
清纯美女米卡
清新靓丽的早晨
玲子的自信与性感
痞子的甘南日记
疑是银河落九天
雪域坝上四——纯美色
冬日恋歌——西城杨柳弄轻柔
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有