
Sdb performance tests ...


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

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

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

Test SELECT 02. Select 100 times without an index. Fetch result.
SELECT count(*), avg(b) FROM t2 WHERE b >= :? AND b < :?
7.687 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 :?
11.719 sec.

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

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

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

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

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

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

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

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

Test INSERT from a SELECT 02. Inside of a transaction.
INSERT INTO t2 SELECT * FROM t1
3.469 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
0.563 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 < :?)
27.125 sec.

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

Test DELETE 02. Run 1 time with an index.
DELETE FROM t2 WHERE a > 10 AND a < 95000
2.14 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(:?, :?, :?)
0.453 sec.
