Re: [sqlite] methods to improve insertion speed with SQLite

2005-09-14 Thread Michael Gross
Hello You can also speed up the inserts when creating the index after the inserts. To check the constraints you could use QDBM (http://qdbm.sourceforge.net/). Rajan, Vivek K wrote: Hello- In my application, I perform large number of insertions (~100K) to create a SQLite database. The

Re: [sqlite] sql help

2005-09-05 Thread Michael Gross
SELECT userid, SUM(CASE WHEN typeid=1 THEN 1 ELSE 0 END)/COUNT(*) AS percent FROM uses GROUP BY userid Cory Nelson wrote: Hey guys, I'm hoping to get some help with this: create table uses(userid integer, typeid integer); insert into uses values(1, 1); insert into uses values(1, 1);

Re: [sqlite] Strange performance problem

2005-08-15 Thread Michael Gross
Khamis Abuelkomboz wrote: CREATE INDEX idx_t2_t1id ON t2 (t1id, deleted); Doent not help. whereas the following quere takes "no" time: SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t1.id=t2.id WHERE t1.deleted<>1 This is fast, because no entries has been found to be joined. This is not true -

[sqlite] Strange performance problem

2005-08-15 Thread Michael Gross
Hello I use sqlite 3.2.2. I have a strange performance problem. I am able to solve the problem by a slight change in the query but I want to ask if somebody can explain this behavior to me: I have two tables: CREATE TABLE t1 (id VARCHAR(40) NOT NULL PRIMARY KEY, deleted BIT); CREATE TABLE