From: Zhangzhigang Date: May 8 2012 10:20am Subject: =?utf-8?B?5Zue5aSN77yaIOWbnuWkje+8miDlm57lpI3vvJog5Zue5aSN77yaIFdoeSBp?= =?utf-8?B?cyBjcmVhdGluZyBpbmRleGVzIGZhc3RlciBhZnRlciBpbnNlcnRpbmcgbWFz?= =?utf-8?B?c2l2ZSBkYXRhIHJvd3M/?= List-Archive: http://lists.mysql.com/mysql/227355 Message-Id: <1336472403.52621.YahooMailNeo@web15206.mail.cnb.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-1147895278-526874883-1336472403=:52621" ---1147895278-526874883-1336472403=:52621 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ok, thanks for your help.=0A=0A=0A=0A________________________________=0A = =E5=8F=91=E4=BB=B6=E4=BA=BA=EF=BC=9A Johan De Meersman = =0A=E6=94=B6=E4=BB=B6=E4=BA=BA=EF=BC=9A Zhangzhigang =0A=E6=8A=84=E9=80=81=EF=BC=9A mysql@stripped; Karen Abgarian <= abvk@stripped> =0A=E5=8F=91=E9=80=81=E6=97=A5=E6=9C=9F=EF=BC=9A 2012=E5=B9= =B45=E6=9C=888=E6=97=A5, =E6=98=9F=E6=9C=9F=E4=BA=8C, =E4=B8=8B=E5=8D=88 6:= 07=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 massive data rows?=0A =0A----- Original Message -----=0A> From: "= Zhangzhigang" =0A> =0A> As i known, the mysql wri= tes the data to disk directly but does not=0A> use the Os cache when the ta= ble is updating.=0A=0AIf it were to use the OS cache for reading but not wr= iting, then the OS cache would be inconsistent with the underlying filesyst= em as soon as you wrote a block, and you'd need some complicated logic to f= igure out which of the two was correct.=0A=0ANo, the MyISAM engine will sim= ply yield to whatever the kernel/VFS wants to do with the blocks; whereas I= nnoDB explicitly opens the files with O_SYNC and bypasses the OS cache enti= rely, 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 ins= erted a lot of rows one by one.=0A=0AFrom the code's point of view, you sim= ply request a read or a write. Wether or not the OS cache gets in between i= s entirely a matter for the kernel to decide, assuming you specified no spe= cific options at file open time.=0A=0A=0A-- =0ABier met grenadyn=0AIs als m= osterd by den wyn=0ASy die't drinkt, is eene kwezel=0AHy die't drinkt, is r= as een ezel=0A=0A-- =0AMySQL General Mailing List=0AFor list archives: http= ://lists.mysql.com/mysql=0ATo unsubscribe:=C2=A0 =C2=A0 http://lists.mysql.= com/mysql ---1147895278-526874883-1336472403=:52621--