[תÔØ]ÄÚ´æÊý¾Ý¿âFastDBºÍSQLiteÐÔÄܲâÆÀ
ÄÚ´æÊý¾Ý¿âFastDBºÍSQLiteÐÔÄܲâÆÀ
×÷Õߣºtamsyn
À´Ô´£ºwww.sqlite.com.cn
ʱ¼ä£º2009-10-21
Ò»¡¢ÒýÑÔ
ÔںܶàÏîÄ¿ÖУ¬¾³£»áÅöµ½ÕâÑùµÄÐèÇó£¬ÐèÒª¶Ô´óÁ¿Êý¾Ý½øÐпìËÙ´æ´¢¡¢²éѯ¡¢É¾³ýµÈ²Ù×÷£¬ÌرðÊÇÔÚһЩÕë¶ÔÖîÈçÔËÓªÉÌ¡¢ÒøÐеȴóÐÍÆóÒµµÄÓ¦ÓÃÖУ¬ÕâЩ
ÐèÇóÓÈΪ³£¼û¡£±ÈÈçÖÇÄÜÍøÖеĴóÁ¿ÔÚÏß²¢·¢Óû§µÄÊý¾Ý¹ÜÀí¡¢Èí½»»»Æ½Ì¨ÖеÄÔÚÏßÐÅÏ¢½»»¥¡¢¿í´ø/3GµÈÊý¾ÝÍøÖÐÔÚÏßÓû§ÐÐΪ¼Ç¼µÈµÈ¡£
Õë¶ÔÕâЩÇéÐΣ¬ÎÒÃÇͨ³£ÐèҪѡÔñ¸ßÐÔÄܵÄÊý¾Ý¿â²úÆ·£¬¶øÇÒͨ³£ÐèҪʹÓÃÄÚ´æÊý¾Ý¿â£¬¹ËÃû˼Ò壬ÄÚ´æÊý¾Ý¿âÖ¸µÄÊÇËùÓеÄÊý¾Ý·ÃÎÊ¿ØÖƶ¼ÔÚÄÚ´æÖнøÐУ¬
ÕâÊÇÓë´ÅÅÌÊý¾Ý¿âÏà¶Ô¶øÑԵģ¬´ÅÅÌÊý¾Ý¿âËäȻҲÓÐÒ»¶¨µÄ»º´æ»úÖÆ£¬µ«¶¼²»ÄܱÜÃâ´ÓÍâÉèµ½ÄÚ´æµÄ½»»»£¬¶øÕâÖÖ½»»»¹ý³Ì¶ÔÐÔÄܵÄËðºÄÊÇÖÂÃüµÄ£¬Ä¿Ç°Ö÷Á÷Êý¾Ý¿â
ÈçSYBASE¡¢ORACLEµÈ¶¼ÓÐÕâÖÖ»º´æ»úÖÆ£¬È罫Ìض¨±í°ó¶¨Ò»¶¨µÄ»º´æ£¬´Ó¶øÔÚÒ»¶¨³Ì¶ÈÉϸÄÉÆÊý¾ÝÍÌÍÂÐÔÄÜ¡£¶øÄÚ´æÊý¾Ý¿â¼¸ºõ¿ÉÒÔÍêÈ«±ÜÃâÕâÖÖÄÚÍâ
´æÊý¾Ý½»»»µÄ·¢Éú£¬ÌرðÊÇÔÚÎïÀíÄÚ´æ×ã¹»´óµÄÉ豸ÉÏÓÈÆäÈç´Ë£¬Í¨³£ÕâÖÖÊý¾Ý¿âÒ²±»³ÆΪÖ÷´æÊý¾Ý¿â(Main Memory DataBase,
MMDB)¡£
¶þ¡¢Ö÷´æÊý¾Ý¿â±È½Ï
Ä¿Ç°±È½ÏÖªÃûµÄÉÌÒµÄÚ´æÊý¾Ý¿âÓУ¬ORACLEµÄTimesTen£¬MCObjectµÄeXtremeDB¡¢º«¹úµÄAltibaseµÈ£¬ÕâЩÊý¾Ý¿â
²úÆ·ÐÔÄܶ¼·Ç³£µÄÇ¿¾¢£¬µ±È»¼Û¸ñÒ²Ï൱µÄÇ¿¾¢£¬ÔÚ·ÇÌØ´óÐÍϵͳ½¨Éèʱ£¬Í¨³£ÈÃÈËÍû¶øÈ´²½¡£ÓÚÊÇÍ˶øÇóÆä´Î£¬Ãâ·Ñ¿ªÔ´ÄÚ´æÊý¾Ý¿â¸øÁËÎÒÃǵڶþÖÖÑ¡Ôñ¡£
Berkeley DB£¬SQLite£¬MonetDB£¬FastDB£¬H2µÈ£¬²»Ò»¶ø×ã¡£±¾ÎÄÖ÷ÒªÕë¶ÔSQLiteºÍFastDB½øÐÐÐÔÄܲâÆÀ¡£
2.1 ²âÊÔ×¼±¸
Ê×ÏÈ£¬±ÊÕßͨ¹ý¶ÔÆÀ²âÊý¾ÝµÄµ÷Ñз¢ÏÖ£¬Í¨³£ÈÏΪ£¬BDBÐÔÄܲ»ÈçSQLite£¬²Î¿¼“Ãâ·ÑµÄʵʱÊý¾Ý¿â£¬ÎÒÃǸÃÑ¡Ë£¿—-BerkeleyDBÓëSQLiteÆÀ²â¶Ô±È ”
¡£
ÉÏÎÄÖл¹Ìáµ½£¬“¾Ý˵FastDBºÜ¿ì£¬µ«Êý¾Ý¿â´óС²»ÄÜ´óÓÚÎïÀíÄÚ´æ…”£¬ÓÚÊDZÊÕ߶ÔFastDB²úÉúÁËÐËȤ£¬´ÓFastDB×÷ÕßµÄÍøÕ¾¿´µ½¹ØÓÚ
ÕâµãµÄ½éÉÜ£¬²¢²»ÊÇ˵Êý¾Ý¿â´óС²»ÄÜ´óÓÚÎïÀíÄڴ棬¶øÊÇ˵Êý¾Ý¿â´óС³¬¹ýÎïÀíÄÚ´æʱ£¬ÐÔÄÜÓë²»³¬¹ýʱÏà±È»áÓÐÒ»¶¨µÄ½µµÍ(½µµÍ·ù¶Èδ×÷˵Ã÷£¬¹À¼ÆÊDz»ÍƼö
ʹÓÃ)¡£ÐÒÔ˵ØÊÇ£¬Ä¿Ç°ÎïÀíÄÚ´æʵÔÚ˵²»ÉϹ󣬷þÎñÆ÷ÄÚ´æÔÚ10GÖ®É϶¼ÊǺÜÕý³£µÄÊÂÇéÁË¡£Òò´Ë¿ÉÒÔ¸ù¾Ý¾ßÌåÏîÄ¿Êý¾ÝÁ¿ÐèÇóÀ´È·¶¨ÊÇ·ñÄÜʹÓÃ
FastDB£¬±ÈÈç²¢²»ÊÇËùÓÐµÄ±í¶¼ÐèÒª·ÅÔÚÄÚ´æÖС£ÏÂÃæ¼´½«ÃèÊöµÄ²âÊÔ±íÃ÷£¬Ò»µ©Ê¹ÓÃFastDB£¬ÆäÐÔÄÜÔÚ
Ïà¹ØÎĵµ£º
1 TOP
ÕâÊÇÒ»¸ö´ó¼Ò¾³£Îʵ½µÄÎÊÌ⣬ÀýÈçÔÚSQLSERVERÖпÉÒÔʹÓÃÈçÏÂÓï¾äÀ´È¡µÃ¼Ç¼¼¯ÖеÄÇ°Ê®Ìõ¼Ç¼£º
SELECT TOP 10 * from [index] ORDER BY indexid DESC;
µ«ÊÇÕâÌõSQLÓï¾äÔÚSQLiteÖÐÊÇÎÞ·¨Ö´Ðеģ¬Ó¦¸Ã¸ÄΪ£º
SELECT * from [index] ORDER BY indexid DESC limit 0,10;
ÆäÖÐlimit 0,10±íʾ´ÓµÚ0Ìõ¼Ç¼¿ªÊ¼£¬Íùºó ......
1¡¢SQLite¼ò½é
¡¡¡¡SQLiteµÚÒ»¸öAlpha°æ±¾µ®ÉúÓÚ2000Äê5ÔÂ. ÖÁ½ñÒѾÓÐ9¸öÄêÍ·ÁË. SQLiteÒ²ÓÀ´ÁËÒ»¸ö°æ±¾ SQLite 3ÒѾ·¢²¼.
¡¡¡¡SQLiteÊÇÒ»¿îÇáÐ͵ÄÊý¾Ý¿â£¬ÊÇ×ñÊØACIDµÄ¹ØÁªÊ½Êý¾Ý¿â¹ÜÀíϵͳ£¬ËüµÄÉè¼ÆÄ¿±êÊÇǶÈëʽµÄ£¬¶øÇÒÄ¿Ç°ÒѾÔںܶàǶÈëʽ²úÆ·ÖÐʹÓÃÁËËü£¬ËüÕ¼ÓÃ×ÊÔ´·Ç³£µÄµÍ£¬ÔÚǶÈëʽÉ豸ÖУ¬¿ÉÄÜÖ»ÐèÒª¼¸°ÙKµ ......
ÔÙ˵ÔÚlinuxϽ¨Á¢.a ºÍµãso
µ½ÍøÕ¾ÏÂÔØ sqlite-amalgamation-3.6.22.tar.gz Õâ¸ö°ü£¬·´ÕýÎÒÏÂÁËsqlite3-3.6.22.bin.gz½âѹºó±àÒë²»ÁË¡£
½âѹ£¬ÔËÐÐ
# ./configure --host=armv5l-linux --prefix=/opt/sqlite3/arm --enable-threadsafe.
......
±¾ÆªÎÄÕÂÀ´Ô´ÓÚ£º¿ª·¢Ñ§Ôº http://edu.codepub.com ÔÎÄÁ´½Ó£ºhttp://edu.codepub.com/2009/0825/14358.php
SQLiteÊǸöµäÐ͵ÄǶÈëʽDBMS£¬ËüÓкܶàÓŵ㣬ËüÊÇÇáÁ¿¼¶µÄ£¬ÔÚ±àÒëÖ®ºóºÜС£¬ÆäÖÐÒ»¸öÔÒò¾ÍÊÇÔÚ²éѯÓÅ»¯·½Ãæ±È½Ï¼òµ¥£¬ËüÖ»ÊÇÔËÓÃË÷Òý»úÖÆÀ´½øÐÐÓÅ»¯µÄ£¬¾¹ý¶ÔSQLiteµÄ²éѯÓÅ»¯µÄ·ÖÎöÒÔ¼°¶ÔÔ´´úÂëµÄ ......
1£º´ÓsqliteµÄ¹ÙÍøÉÏÏÂÔØÔ´Âë http://www.sqlite.org/download.html
2£º´ò¿ªvs2008¹¤³Ìн¨Ò»¸ö¿ÕµÄdll¹¤³Ì¡£
3£º°Ñsqlite3.h,sqlite3.cpp,sqlite3.def·Ö±ð¼ÓÈëµ½head file ºÍsource fileÏ¡£
4£º±àÒë³ÌÐò¡£ ÕâʱֻÄܵõ½sqlite3.dllÎļþ¡£
5£º´ò¿ªvs2008×Ô´øµÄÃüÁîÐУº Çе½sqlite3.defËùÔÚµÄĿ¼¡£
6£ºÔËÐÐ ......