Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

[תÔØ]ÄÚ´æÊý¾Ý¿â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£¬ÆäÐÔÄÜÔÚ


Ïà¹ØÎĵµ£º

ǶÈëʽÊý¾Ý¿âµäÐͼ¼Êõ¨DSQLiteºÍBerkeley DBµÄÑо¿

Õª Òª: Óë³£¼ûµÄÊý¾Ý¿âÏà±È£¬Ç¶Èëʽ
Êý
¾Ý¿â¾ßÓÐÌå»ýС¡¢¹¦ÄÜÆ뱸¡¢¿ÉÒÆÖ²ÐÔ¡¢½¡×³ÐÔµÈÌص㣬±¾ÎÄ·ÖÎöºÍ±È½ÏÁ˵äÐ͵ÄǶÈëʽÊý¾Ý¿âSQLiteºÍBerkeley DB¡£Ê×ÏÈ´ÓÌåϵ½á¹¹¡¢×Óϵͳ
¼äµ÷ÓùØϵ¡¢ÈÎÎñÖ´Ðйý³ÌµÈ½Ç¶È¶ÔSQLiteºÍBerkeley DB½øÐÐÁËÏêϸ·ÖÎö£¬È»ºóÖصã´ÓÊý¾ÝÀàÐÍ¡¢´æ´¢·½Ê½¡¢Ä£Ê½¡¢Êý¾Ý¿âÒýÇ ......

SQLite²»Ö§³ÖµÄSQLÓï·¨×ܽá


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Ìõ¼Ç¼¿ªÊ¼£¬Íùºó ......

SQLiteÆô¶¯ÊÂÎï

ÊÂÎñ£¨DbTransaction£©£º
SQLite ȱʡΪÿ¸ö²Ù×÷Æô¶¯Ò»¸öÊÂÎñ£¬ËùÒÔ³ÉÅú²åÈëµÄʱºò£¬Æô¶¯ÊÂÎñ£¬±È²»Æô¶¯ÊÂÎñ¿ìn±¶¡£
ÔÚûÆô¶¯ÊÂÎñ֮ǰÍùSqliteÊý¾Ý¿âÀï²åÈë1000¶àÌõÊý¾ÝµÄÇé¿ö,½á¹ûÿ´Î¶¼ÐèÒªÒ»Á½·ÖÖÓ²ÅÄÜÍê³É.
¶øÔÚÆô¶¯ÊÂÎïÒÔºóËùÐèÒªµÄʱ¼äÖ±½Ó±ä³É²»µ½2Ãë!Ô­À´sqlite»¨Á½·ÖÖÓÊÇÓÉÓÚExecuteNonQuery·½·¨Ö´ÐÐʱ×Ô¼ºÌá½» ......

SQLite DatabaseÅжÏÊÇ·ñ´æÔÚ¡¢Ð½¨¡¢É¾³ý.....

¡¡Android SQLite Database±¾´òËã·â×°SQLiteµÄ£¬µ«ÊÇ£¬·¢ÏÖʵ¼ÊÉÏAndroidÒѾ­·â×°ÁËÒ»²ã£¬ÓÈÆäÊÇÊý¾ÝµÄÔö¡¢É¾¡¢²é¡¢¸ÄÉÏ£¬¸üÊÇÈç´Ë£¬ËùÒÔ£¬ÎÒºóÀ´Ö»·â×°ÁËÒ»¸öÁ¬½Ó²ã£¬¸ºÔð´ò¿ª¡¢½¨Á¢Êý¾Ý¿â£¬²¢·µ»ØÒ»¸öSQLiteµÄʵÀýÓÃÀ´Íê³ÉÔö¡¢É¾¡¢²å¡¢¸ÄµÈ²Ù×÷¡£
//----------- DBHelper -------------
package utility.db;
import ja ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ