????????
???????????????????????SQLite??з???????“table xxx already exists”??????DB????в???и????????????????SQLite?????????е????bug???????bug?????????????????????????????????????SQLite???????????????????????????????????????SQLite???????????????????
????????
????SQLite?л???????????????棬??????仺???????????檔SQLite????????????????????е???????????DB????У???????(page)????????????????????page??1024??????????????η????????????IO????????????SQLite?????????????
????pagecache??pagecache???????????????????SQLite???????????????????????????????????????????????????????????????????????????????????????????????????????????????????DB????С???????????????????????????????????????????м?????(?????????????????????????????????????????????)???????λ????Щ?????????????DB????л??????????????????????????????????pagecache???????????????????????????pagecahce?У??????????page?е??????????????????????????н????????????????????á????????????????????????????????????????????????????л??棬?????????????Ч???
??????????????????
????????????????????????????MySQL???????BufferPool??????????????Oracle??SQLServer???????????
???????PC??????????????????????????????????????趨??????????????С??BufferPool????SQLite????????????????“?????????????”??pagecache????С??2000??page??2000??page???????????????????????????????????????????????????????????????????????????????????????棬????SQLite?????????豸??????????????????????????SQLite??????????????LRU????????????page????????page??
????SQLite???????????????????DB???????????DB????????????????pagecache??????????????????DB????У???????DB??????????????????棬????????PC??????(????MySQL?У????????????BufferPool)????????DB????ж???????棬????????????????????????Connection1??Connection2?????????Connection1?????????ж????page_A??????????棻???Connection2???????ж??Page_A????????????£??????Connection1??ζ??page_A???Connection1??????????????page_A??????????????????μ?DB????ж????
????SQLite???????????????DB???????????д???DB??汾???????????SQL?????DB??汾????????棬??η?????ε?汾??????????????????DB???????????????????????檔???????????????????pager_write_changecounter???и??£?????λ??????????24???????4??????
??????????仺???????
??????????????????????????MySQL???????information_schema?????????仺?????????????????????洢????SQLite????????????Hash??洢??????(tblHash??idxHash??trigHash??fkeyHash??)?ж?????????????????????Hash???ж??????????openDatabase???????????sqlite3Init???????????г?????????????????????????????????仺????????DB????е???????????????????SQLite??????????????????????汾?????????λ??????????40???????4??????????DDL?????(CREATE??DROP??ALTER??)???????sqlite3ChangeCookie???????汾??(Schema cookie)????Prepare??η?????????????????????????????Schema cookie??飬?????????????£???????sqlite3SchemaClear?????????????????????????????SQLite?????????????????????sqlite_master???У????????????м????????а????????壬?????????????????????????????飬???????sqlite3EndTable?????????Hash??????????
????С??
????????????????????????????????????仺??????SQLite???????????汾????????汾????????????????????????????????DBд?????????????ζ???????????????IO????????????A???????B??????????????????????????????????????“??????”???????????????????????С????????????仺?棬??????????????????????????????????????????????????汾????????SQLite??????????????SQL?????ж??????汾????£?????????????????????????????????汾????????????????????????????????????????????????????????????
???????????
???????????????????SQLite??bug?????????????????????????????DB??????????A??B????????????У? A??create table t(id int); B??DROP table if exists t; A: create table t(id int); ?????A???????“table t already exists”???????????????????????????????????3??A????????????????д?????ж????????????μ??????????????????????????????sharecache???????sharecache???£????е?DB????????????????????????????????2???????????????????