Alessandro,

Take a few minutes to read the different wiki pages. There is a lot of info there. Answering your question:

http://www.sqlite.org/cvstrac/wiki?p=PerformanceTuning

Just scroll at the end of the page: Use transactions when updating tables. Another reference:

http://www.sqlite.org/cvstrac/wiki?p=MultiThreading

Regards,

-- Tito

On Jan 31, 2005, at 10:49, Alessandro Renzi (RM/TEI) wrote:

Hi,
I'm a new sqlite user.
For sure I'm doing something wrong with sqlite because it takes about 1 second to perform 10 INSERT operation !
If instead I use the sqlite client and read an external file with thousands of INSERT operation the updating is
almost immediate.
The test program I'm using is the following one:


        char * sql = "INSERT INTO PEOPLE (NAME, AGE) VALUES ('John','25')";
        for (int i=0; i<100; i++) {
                rc = sqlite_exec(db,sql,callback,0,&zErrMsg);
                if( rc!=SQLITE_OK ){
                        fprintf(stderr, "SQL error: %s\n", zErrMsg);
                        return 1;
                }
        }

Where I'm wrong ?
Thanks, Ale




Reply via email to