Re: [sqlite] weird problem with windows 2000 PLEASE HELP!!!

2005-09-17 Thread dan greene
So, if I'm reading your message right,  the 25 seconds for inserting 200 
(that is only 200 messsages)  into a database under win 2000 is correct???
Perhaps it's just my  uneducated opinion but your explanation sounds 
bogus...  Why would the folks who wrote SQLITE show it off as being so fast 
if, under win 2000, it only added 200 records every 25 seconds
And, why does adding a begin: / end:commit: around the whole loop speed up 
the operations so drastically???


Plase help!!!??



[sqlite] weird problem with windows 2000

2005-09-15 Thread dan greene

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,);
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



[sqlite] questions from a new user

2005-09-10 Thread dan greene

Hi,
I have just recently come across the SQLITE database library and it appears 
to be just the library I've been looking for.
I do have a few questions that perhaps another, more experienced SQLITE 
user, could answer.


1.  Does anyone have a zipped up version of the SQLITE documentation? The 
online documentation is great but on at least one of my development systems 
I don't have web access.  A local copy on my windows machine would make 
things easier.


2.  Could someone give me a brief  overview on how to insert and retrieve 
BLOB data in SQLITE?  It seems to me that sqlite3_exec is fine for 
selecting and inserting rows when the column data being used is a 
0-terminated string.   But what is the general approach if one or more 
columns contain variable-length binary data?


Thanks for any help!

Cheers
Dan Greene