Perhaps one of you can shed some light on this problem I'm having.
First, I am using the SQLITE3 dll, both as provided by sqlite.org and as I
compiled under Visual C++ V6. The problem shows up no matter what dll I'm
using.
One of my machines is a 2.99 GHZ Windows 2000 machine with NTFS.
A second machine I'm using is a 2.21 GHZ machine running Windows 98 SE.
I wrote a little program to test SQLITE3, essentially, a program to add 200
records to a table called notes with one column, subject.
The loop I used to enter the rows is shown below:
// time the additions
t1=clock();
// add some rows
for(i=1;i<201;i++)
{
char *statement;
char buffer[50];
sprintf(buffer,"my subject%d",i);
statement = sqlite3_mprintf("insert into notes(subject) values('%q');",buffer);
stat = sqlite3_exec(db,statement,0,0,&errmsg);
if(stat != SQLITE_OK)
{
printf("insert error at i=%1d: %s\n",i,errmsg);
sqlite3_free(errmsg);
break;
}
sqlite3_free(statement);
}// for
t2 = clock();
printf("added %d records to notes\n",i-1);
printf("elapsed time: %d\n",(t2-t1));
When I ran this program on the win2000 machine with NTFS, this loop took on
the order of 25 seconds as reported in the second printf!
When I ran the same program on my win98 machine, it took 1.1 seconds.
putting a begin; and end;commit; SQL around the entire loop, dropped the
execution on both machines into the tens of milliseconds.
Any thoughts as to what is happening on the WIN2000 NTFS machine to slow
down the single inserts so drastically?
Cheers
Dan Greene