[sqlite] "is not null" and index

2011-10-17 Thread Yoav Apter
Hi

I have the following table:

CREATE TABLE x ('col1', 'col2', 'col3')
Create col1index on x ('col1')

When I run this query: "select * from x where col1 is null" I see the index on 
x is used.
When I run this query: "select * from x where col1 is NOT null" I see the index 
on x is not used.

How can indexes be used with "not null" queries?


Thanks


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


[sqlite] SQLITE_CANTOPEN returned from sqlite3_step

2010-07-15 Thread Yoav Apter
Thanks. It is indeed a problem with a temp file - I set the temporary directory 
with an uninitialized value.


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


[sqlite] SQLITE_CANTOPEN returned from sqlite3_step

2010-07-15 Thread Yoav Apter
Hi

We are building a Windows application using a read-only Sqlite database. When 
executing many queries in a short time, we sometimes get SQLITE_CANTOPEN from 
sqlite3_step. Checking GetLastError gives us error code 123: The filename, 
directory name, or volume label syntax is incorrect. If we open the database in 
read-write mode this problem is not reproduced.

This is the only application accessing the database and only from a single 
thread (although the application has other threads).

Using ProcMon we notice that when this happens, Sqlite is trying to open a new 
file with a gibberish name which explains the OS error. At what time does 
sqlite3_step needs top open a file (considering the database is opened in 
read-only mode?) what can explain the weird file name?


Thanks



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


[sqlite] FTS and sorting

2010-06-29 Thread Yoav Apter

Hi

What is the most efficient way to sort a result set from an FTS table?

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