
Sdb performance tests ...


Test INSERT 01. Insert 4000 records. Autocommit.
INSERT INTO t1 VALUES(:?, :?, :?)
0.141 sec.

Test INSERT 02. Insert 100000 records. Inside of a transaction.
INSERT INTO t2 VALUES(:?, :?, :?)
3.531 sec.

Test INSERT 03. Insert 100000 records into an indexed table. Inside of a transaction.
INSERT INTO t3 VALUES(:?, :?, :?)
4.75 sec.

Test SELECT 02. Select 100 times without an index. Fetch result.
SELECT count(*), avg(b) FROM t2 WHERE b >= :? AND b < :?
27.922 sec.

Test SELECT 03. Select 100 times without an index on a string comparison. Fetch result.
SELECT count(*), avg(b) FROM t2 WHERE c LIKE :?
54.344 sec.

Test INNER JOIN 01. Without an index. Fetch result.
SELECT t1.a FROM t1 INNER JOIN t2 ON t1.b = t2.b
0.14 sec.

Test CREATE INDEX 01. Run 1 time on an ordered field.
CREATE INDEX i2a ON t2(a)
0.11 sec.

Test CREATE INDEX 02. Run 1 time on a nonordered field.
CREATE INDEX i2b ON t2(b)
0.109 sec.

Test SELECT 04. Select 1000 times with an index. Fetch result.
SELECT count(*), avg(b) FROM t2 WHERE b >= :? AND b < :?
3.016 sec.

Test UPDATE 01. Update 400 times without an index. Inside of a transaction.
UPDATE t1 SET b = b*2 WHERE a >= :? AND a < :?
6.265 sec.

Test UPDATE 02. Update 4000 times with an index. Inside of a transaction.
UPDATE t2 SET b = :? WHERE a = :?
1.86 sec.

Test UPDATE 03. Update 4000 times a text value with an index. Inside of a transaction.
UPDATE t2 SET c = :? WHERE a = :?
2.015 sec.

Test INSERT from a SELECT 01. Inside of a transaction.
INSERT INTO t1 SELECT * FROM t2
0.531 sec.

Test INSERT from a SELECT 02. Inside of a transaction.
INSERT INTO t2 SELECT * FROM t1
2.61 sec.

Test INNER JOIN 02. With index on one side. Fetch result.
SELECT t1.a FROM t1 INNER JOIN t2 ON t1.b = t2.b
4.109 sec.

Test SELECT 05. Select 100 times with subqueries. Subquery is using an index. Fetch result.
SELECT t1.a FROM t1 WHERE t1.b IN (SELECT t2.b FROM t2 WHERE t2.b >= :? AND t2.b < :?)
11.625 sec.

Test DELETE 01. Run 1 time without an index.
DELETE FROM t2 WHERE c LIKE '%fifty%'
0.766 sec.

Test DELETE 02. Run 1 time with an index.
DELETE FROM t2 WHERE a > 10 AND a < 95000
6.672 sec.

Test DELETE 03. A big DELETE followed by many small INSERTs.
Run 4000 times. Inside of a transaction.
DELETE FROM t1
INSERT INTO t1 VALUES(:?, :?, :?)
3.265 sec.
