Re: [sqlite] Performance of SELECT: What am I doing wrong?

2011-10-26 Thread Nico Williams
On Wed, Oct 26, 2011 at 5:01 PM, Jay A. Kreibich wrote: >  The use of IS is causing the query optimizer to use a full table >  scan, essentially turning the query into a O(n) operation.  This has >  to do with how IS differs from = in the handling of NULLs.  Since it >  is

Re: [sqlite] Performance of SELECT: What am I doing wrong?

2011-10-26 Thread Jay A. Kreibich
On Wed, Oct 26, 2011 at 11:35:33PM +0200, Tobias Mohrl?der scratched on the wall: > On Wednesday, Oct 26, 2011 at 02:26PM Jay A. Kreibich wrote: > > > On Tue, Oct 25, 2011 at 11:51:46PM +0200, Tobias Mohrl?der scratched on the > > wall: > >> Hello everybody, > >> > >> I strongly believe that

Re: [sqlite] Performance of SELECT: What am I doing wrong?

2011-10-26 Thread Tobias Mohrlüder
On Wednesday, Oct 26, 2011 at 02:26PM Jay A. Kreibich wrote: > On Tue, Oct 25, 2011 at 11:51:46PM +0200, Tobias Mohrlüder scratched on the > wall: >> Hello everybody, >> >> I strongly believe that my setup is somehow wrong, I just can't figure >> out how. > > >> sqlite3_prepare_v2(db, "SELECT

Re: [sqlite] Performance of SELECT: What am I doing wrong?

2011-10-26 Thread Jay A. Kreibich
On Tue, Oct 25, 2011 at 11:51:46PM +0200, Tobias Mohrlüder scratched on the wall: > Hello everybody, > > I strongly believe that my setup is somehow wrong, I just can't figure > out how. > sqlite3_prepare_v2(db, "SELECT * FROM mytable WHERE MyKey IS ?", -1, , > 0); Don't use "IS", use "=".

[sqlite] Performance of SELECT: What am I doing wrong?

2011-10-26 Thread Tobias Mohrlüder
Hello everybody, I'm currently experimenting with SQLite (3.7.8) and am a complete newbie in the field of SQL databases. Running performance comparisons between a C++ std::map< int, std::string > and an in-memory SQLite database, I found SQLite to be astonishingly slow when selecting single