Simon Slavin wrote:
> On 7 May 2014, at 1:29pm, Woody Wu <narkewo...@gmail.com> wrote:
>> The 'explain query plan' gives same result for the first and the second 
>> query:
>>
>> 0|0|0|SEARCH TAB mp USING COVERING INDEX sqlite_auto_index_mp_1 (ntimereq<?) 
>> (~1 rows)
>>
>> BTW: I dont understand what the (~1 rows) mean.
>
> Literally "about 1 row".  This is SQLite's estimate of how many rows the 'mp' 
> table has.

Actually, the estimate of how many rows will match this search.

SQLite assumes that such a comparison is useful for reducing the number
of result rows.  In this case, the estimate is quite wrong.

> You can let SQLite make a better estimate by using the 'ANALYZE' command.

Yes.  However, even if a better estimate were to show that this index is
not very useful, there would exist, at the moment, no better index (with
id1 or id2 as the first indexed column).


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

Reply via email to