Regarding: "There's no way to optimize your query to be fast in both

I do *not* know if this would be of any help, but the newest 3.1.18
sqlite release which includes the SQLITE_ENABLE_STAT2 feature may
possibly be of interest:  (and excuse me if you've mentioned this

    This option adds additional logic to the ANALYZE command and to the
query planner that can help SQLite to chose a better query plan under
certain situations. The ANALYZE command is enhanced to collect a
10-sample histogram of the data in each index and store that histogram
in the sqlite_stat2 table. The query planner will then use the histogram
data to help it estimate how many rows will be selected by a range
constraint in a WHERE clause.  

Donald Griggs
sqlite-users mailing list

Reply via email to