Sqlite China  
首页 | 各种语言的sqlite编程 | sqlite研究 |sqlite应用实例与杂谈 | sqlite相关下载 | SQlite论坛
当前位置 : 主页>sqlite研究>列表
SQLite 数据库的速度比较(wiki) (2)
来源:工友 作者:工友 时间:2007-12-21

Test 2: 25000 INSERTs in a transaction

BEGIN;
CREATE TABLE t2(a INTEGER, b INTEGER, c VARCHAR(100));
INSERT INTO t2 VALUES(1,298361,'two hundred ninety eight thousand three hundred sixty one');
... 24997 lines omitted
INSERT INTO t2 VALUES(24999,447847,'four hundred forty seven thousand eight hundred forty seven');
INSERT INTO t2 VALUES(25000,473330,'four hundred seventy three thousand three hundred thirty');
COMMIT;
SQLite 3.3.3 (sync):    0.764
SQLite 3.3.3 (nosync):    0.748
SQLite 2.8.17 (sync):    0.698
SQLite 2.8.17 (nosync):    0.663
PostgreSQL 8.1.2:    16.454
MySQL 5.0.18 (sync):    7.833
MySQL 5.0.18 (nosync):    7.038
FirebirdSQL 1.5.2:    4.280

Test 3: 25000 INSERTs into an indexed table

BEGIN;
CREATE TABLE t3(a INTEGER, b INTEGER, c VARCHAR(100));
CREATE INDEX i3 ON t3(c);
... 24998 lines omitted
INSERT INTO t3 VALUES(24999,442549,'four hundred forty two thousand five hundred forty nine');
INSERT INTO t3 VALUES(25000,423958,'four hundred twenty three thousand nine hundred fifty eight');
COMMIT;
SQLite 3.3.3 (sync):    1.778
SQLite 3.3.3 (nosync):    1.832
SQLite 2.8.17 (sync):    1.526
SQLite 2.8.17 (nosync):    1.364
PostgreSQL 8.1.2:    19.236
MySQL 5.0.18 (sync):    11.524
MySQL 5.0.18 (nosync):    12.427
FirebirdSQL 1.5.2:    6.351

Test 4: 100 SELECTs without an index

SELECT count(*), avg(b) FROM t2 WHERE b>=0 AND b<1000;
SELECT count(*), avg(b) FROM t2 WHERE b>=100 AND b<1100;
SELECT count(*), avg(b) FROM t2 WHERE b>=200 AND b<1200;
... 94 lines omitted
SELECT count(*), avg(b) FROM t2 WHERE b>=9700 AND b<10700;
SELECT count(*), avg(b) FROM t2 WHERE b>=9800 AND b<10800;
SELECT count(*), avg(b) FROM t2 WHERE b>=9900 AND b<10900;
SQLite 3.3.3 (sync):    3.153
SQLite 3.3.3 (nosync):    3.088
SQLite 2.8.17 (sync):    3.993
SQLite 2.8.17 (nosync):    3.983
PostgreSQL 8.1.2:    5.740
MySQL 5.0.18 (sync):    2.718
MySQL 5.0.18 (nosync):    1.641
FirebirdSQL 1.5.2:    2.976

Test 5: 100 SELECTs on a string comparison

SELECT count(*), avg(b) FROM t2 WHERE c LIKE '%one%';
SELECT count(*), avg(b) FROM t2 WHERE c LIKE '%two%';
SELECT count(*), avg(b) FROM t2 WHERE c LIKE '%three%';
... 94 lines omitted
SELECT count(*), avg(b) FROM t2 WHERE c LIKE '%ninety eight%';
SELECT count(*), avg(b) FROM t2 WHERE c LIKE '%ninety nine%';
SELECT count(*), avg(b) FROM t2 WHERE c LIKE '%one hundred%';
SQLite 3.3.3 (sync):    4.853
SQLite 3.3.3 (nosync):    4.868
SQLite 2.8.17 (sync):    4.511
SQLite 2.8.17 (nosync):    4.500
PostgreSQL 8.1.2:    6.565
MySQL 5.0.18 (sync):    3.424
MySQL 5.0.18 (nosync):    2.090
FirebirdSQL 1.5.2:    5.803

Test 6: INNER JOIN without an index

SELECT t1.a FROM t1 INNER JOIN t2 ON t1.b=t2.b;
SQLite 3.3.3 (sync):    14.473
SQLite 3.3.3 (nosync):    14.445
SQLite 2.8.17 (sync):    47.776
SQLite 2.8.17 (nosync):    47.750
PostgreSQL 8.1.2:    0.176
MySQL 5.0.18 (sync):    3.421
MySQL 5.0.18 (nosync):    3.443
FirebirdSQL 1.5.2:    0.141

Test 7: Creating an index

CREATE INDEX i2a ON t2(a);
CREATE INDEX i2b ON t2(b);
SQLite 3.3.3 (sync):    0.552
SQLite 3.3.3 (nosync):    0.526
SQLite 2.8.17 (sync):    0.650
SQLite 2.8.17 (nosync):    0.605
PostgreSQL 8.1.2:    0.276
MySQL 5.0.18 (sync):    1.159
MySQL 5.0.18 (nosync):    0.275
FirebirdSQL 1.5.2:    0.264
(阅读次数:
上一篇:SQLite 数据库的速度比较(wiki) (1) 下一篇:SQLite 数据库的速度比较(wiki) (3)
[收藏] [推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]
用户名: 新注册) 密码: 匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
§最新评论
热点文章
·SQLite数据库的体系结构
·SQLite与其他数据库的速度
·SQL 语言参考资料
·SQLite语法备忘录
·sqlite 的相关调查1
·嵌入式数据库SQLite的一份
·SQLite在嵌入式Web服务器
·点评主流开源数据库的技术
·基于ARM-Linux的SQLite嵌
·SQLite与其他数据库的速度
·SQLite数据库编程--创建数
·SQL 语法手册
·SQLite Mode 数据库交互的
·SQLITE3 使用总结(3)
·XXTEA加密算法为SQLite 3.
·SQLite 第三版总览(简介)
·SQLite 第三版中的数据类
·用sqlite 执行标准 sql 语
·System.Data.Sqlite 上手
·SQLite编译安装步骤
相关文章
·SQLite Mode 数据库交互的
·SQL 语言参考资料
·SQLite在嵌入式Web服务器
·SQL 语法手册
·System.Data.Sqlite 上手
·SQLite数据库编程--创建数
·SQLite数据库编程--数据库
·SQLite在TorqueScript中的
·关于sqlite_exec回调函数
·用sqlite 执行标准 sql 语

版权Power by DedeCms   后台登陆
Copyright @ 2007