Re: [sqlite] SELECT (...) GROUP BY not returns!

2005-04-09 Thread Adam Dziendziel
[EMAIL PROTECTED] wrote: COUNT(*) returns NULL if there are no records selected. Change the query like this to accomplish what you're looking for: SELECT COALESCE(COUNT(*), 0) FROM drzewo_towar WHERE lft > 13 AND rgt < 14 GROUP BY towar; Thanks! But it's a bit strange - if I r

Re: [sqlite] beat 120,000 inserts/sec

2005-04-09 Thread bbum
There are also pragmas to control page size and in-memory caching. You will want to play with those, as well. If SQLite is in the middle of a transaction and you load it up with commands, it will create a journal file in /tmp/ to start pages that don't fit in the in-memory page cache (or some

[sqlite] Problem when asking for databases that don't exist

2005-04-09 Thread Jochen Müller
Hello! I am new to SQL and have a simple question concerning sqlite. I am using the functions sqlite3_open, sqlite3_get_table and sqlite3_free_table and sqlite3_close. Because i do not yet know how to check whether a database exists or not, i always call the sqlite3_get_table function. If it r

Re: [sqlite] SELECT (...) GROUP BY not returns!

2005-04-09 Thread Ken & Deb Allen
In this specific case, examining your original data, there will be no records that match your selection criteria. Normally, one would expect a single record to be returned with a single column that contains a zero value. Using the GROUP BY changes this, and the query will attempt to return one

Re: [sqlite] Problem when asking for databases that don't exist

2005-04-09 Thread Ken & Deb Allen
To determine whether a specific database exists, check to see if the file exists before calling sqlite3_open(), using stat() or some other call. To determine if a specific schema exists within an open database, use the query "SEELCT COUNT(*) FROM sqlite_master WHERE type = 'table' AND name IN

Re: [sqlite] beat 120,000 inserts/sec

2005-04-09 Thread Clay Dowling
Jeremy Hinegardner wrote: > ./sqlite_insert 10 5 10 inserts to /tmp/a.db in 0.671 s = 149057.52 inserts/s ./sqlite_insert 200 2 200 inserts to /tmp/a.db in 14.437 s = 138535.38 inserts/s ./sqlite_insert 200 5 200 inserts to /tmp/a.db in 15.322 s = 130530.52 i

Re: [sqlite] beat 120,000 inserts/sec

2005-04-09 Thread Al Danial
On Apr 9, 2005 12:43 AM, Andy Lutomirski <[EMAIL PROTECTED]> wrote: > Al Danial wrote: > > The attached C program measures insert performance for populating > > a table with an integer and three random floating point values with > > user defined transaction size. Usage is: > > > > ./sqlite_ins

Re: [sqlite] beat 120,000 inserts/sec

2005-04-09 Thread Andrew Piskorski
On Sat, Apr 09, 2005 at 11:49:17AM -0400, Al Danial wrote: > Thanks to everyone who posted performance numbers and machine > setup info. Some results were counterintuitive (I'd have guessed > SCSI drives would come out on top) but many variables are at work It is basically impossible that a 10k

Re: [sqlite] beat 120,000 inserts/sec

2005-04-09 Thread Andy Lutomirski
Andrew Piskorski wrote: On Sat, Apr 09, 2005 at 11:49:17AM -0400, Al Danial wrote: Thanks to everyone who posted performance numbers and machine setup info. Some results were counterintuitive (I'd have guessed SCSI drives would come out on top) but many variables are at work It is basically imp

Re: [sqlite] SELECT (...) GROUP BY not returns!

2005-04-09 Thread Adam Dziendziel
Ken & Deb Allen wrote: Using the GROUP BY changes this, and the query will attempt to return one record for each "towar" value that matches the selection criteria; since there are none, no records are returned. When using a COUNT(*) and a GROUP BY together, one normally includes the GROUP BY co

Re: [sqlite] beat 120,000 inserts/sec

2005-04-09 Thread bbum
On Apr 9, 2005, at 8:49 AM, Al Danial wrote: I did try SYNCHRONOUS=off but that didn't seem to have an effect; I'll study the docs to make sure I've got it right. This isn't surprising. fsync() is largely a no-op on just about any operating system. It doesn't actually guarantee that the bytes ar