Re: [sqlite] Restricting fast no-result query yields slow no-result query

2010-02-05 Thread Simon Slavin
On 5 Feb 2010, at 5:05am, Kelly Jones wrote: > I have a query that runs very quickly and returns no results: > > SELECT * FROM filebackup WHERE sha1='x'; > > However, the more restrictive query below runs very slowly, although > it obviously can't have any results either: > > SELECT * FROM

[sqlite] Restricting fast no-result query yields slow no-result query

2010-02-04 Thread Kelly Jones
I have a query that runs very quickly and returns no results: SELECT * FROM filebackup WHERE sha1='x'; However, the more restrictive query below runs very slowly, although it obviously can't have any results either: SELECT * FROM filebackup WHERE sha1='x' AND refid=0; I have indexes on both