Jay A. Kreibich schreef:
> On Sat, Oct 10, 2009 at 11:57:30PM +0200, Ron Arts scratched on the wall:
> 
>> I'm expanding my benchmark to test just thaty, but I'm running into a 
>> problem.
>> Here's my code (well part of it):
>>
>>    sqlite3_stmt *stmt;
>>    rc = sqlite3_prepare(db, "select name from company where id = '?'", -1, 
>> &stmt, NULL);
> 
> 
>> The sqlite3_bind_int immediately gives me an RANGE_ERROR (25).
>> Is there some obvious thing I'm doing wrong?
> 
>   Remove the single quotes.  They aren't required for parameters, even
>   if you're binding a text value.
> 
>   As written, that statement has a single character string literal and
>   no parameters.
> 
>    -j
> 

Yep that did it, sorry, I'm pretty new to sqlite.

Here's my new benchmark output:

sqlite3 insert 500000 records time: 17.19 secs
sqlite3 select 500000 records time: 18.57 secs
sqlite3 prepared select 500000 records time: 3.27 secs
glib2 hash tables insert 500000 records time: 0.38 secs
glib2 hash tables lookup 500000 records time: 0.24 secs

The prepared select indeed speeds up things tremendously, a 5-fold increase.
Now I can do around 30000 requests per second, of course I need to keep
prepared versions of all the sql statements I use.

This is beginning to look feasible now! I'll have to investigate my
own processing a bit more, see if my assumption of 5 queries
per request is realistic.

Thanks so far,

Ron





_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to