From: Zhangzhigang Date: May 9 2012 1:28am Subject: =?utf-8?B?5Zue5aSN77yaIOWbnuWkje+8miDlm57lpI3vvJog5Zue5aSN77yaIFdoeSBp?= =?utf-8?B?cyBjcmVhdGluZyBpbmRleGVzIGZhc3RlciBhZnRlciBpbnNlcnRpbmcgbWFz?= =?utf-8?B?c2l2ZSBkYXRhIHJvd3M/?= List-Archive: http://lists.mysql.com/mysql/227367 Message-Id: <1336526937.97599.YahooMailNeo@web15201.mail.cnb.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-1348685567-699473128-1336526937=:97599" ---1348685567-699473128-1336526937=:97599 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =C2=A0Oh... I thought that it uses it's own buffer cache as same as the Inn= oDB. I have got a mistake for this,=C2=A0 thanks!=0A=0A=0A=0A______________= __________________=0A =E5=8F=91=E4=BB=B6=E4=BA=BA=EF=BC=9A Karen Abgarian <= abvk@stripped>=0A=E6=94=B6=E4=BB=B6=E4=BA=BA=EF=BC=9A mysql@stripped= m =0A=E5=8F=91=E9=80=81=E6=97=A5=E6=9C=9F=EF=BC=9A 2012=E5=B9=B45=E6=9C=889= =E6=97=A5, =E6=98=9F=E6=9C=9F=E4=B8=89, =E4=B8=8A=E5=8D=88 2:51=0A=E4=B8=BB= =E9=A2=98: Re: =E5=9B=9E=E5=A4=8D=EF=BC=9A =E5=9B=9E=E5=A4=8D=EF=BC=9A =E5= =9B=9E=E5=A4=8D=EF=BC=9A Why is creating indexes faster after inserting mas= sive data rows?=0A =0AHi, =0A=0AIf MyISAM tables were being written directl= y to disk, the MyISAM tables would be so slow that nobody would ever use th= em.=C2=A0 =C2=A0 That's the cornerstone of their performance, that the writ= es do not wait for the physical I/O to complete!=0A=0A=0A=0AOn May 8, 2012,= at 3:07 AM, Johan De Meersman wrote:=0A=0A> ----- Original Message -----= =0A>> From: "Zhangzhigang" =0A>> =0A>> As i known= , the mysql writes the data to disk directly but does not=0A>> use the Os c= ache when the table is updating.=0A> =0A> If it were to use the OS cache fo= r reading but not writing, then the OS cache would be inconsistent with the= underlying filesystem as soon as you wrote a block, and you'd need some co= mplicated logic to figure out which of the two was correct.=0A> =0A> No, th= e MyISAM engine will simply yield to whatever the kernel/VFS wants to do wi= th the blocks; whereas InnoDB explicitly opens the files with O_SYNC and by= passes the OS cache entirely, because it manages it's own buffer cache.=0A>= =0A>> If it writes to the Os cache, which leads to massive system invoking= ,=0A>> when the table is inserted a lot of rows one by one.=0A> =0A> From t= he code's point of view, you simply request a read or a write. Wether or no= t the OS cache gets in between is entirely a matter for the kernel to decid= e, assuming you specified no specific options at file open time.=0A> =0A> = =0A> -- =0A> Bier met grenadyn=0A> Is als mosterd by den wyn=0A> Sy die't d= rinkt, is eene kwezel=0A> Hy die't drinkt, is ras een ezel=0A> =0A> -- =0A>= MySQL General Mailing List=0A> For list archives: http://lists.mysql.com/m= ysql=0A> To unsubscribe:=C2=A0 =C2=A0 http://lists.mysql.com/mysql=0A> =0A= =0A=0A-- =0AMySQL General Mailing List=0AFor list archives: http://lists.my= sql.com/mysql=0ATo unsubscribe:=C2=A0 =C2=A0 http://lists.mysql.com/mysql ---1348685567-699473128-1336526937=:97599--