On 3/5/15, Mike Nicolino <mike.nicolino at centrify.com> wrote:
> I'm using System.Data.SQLite version 1.0.95.0 and have what appears to be a
> bug with Virtual Tables.  Queries using 'like' in the where clause are not
> getting the like clause passed to BestIndex as a query constraint.
> Specifically:
>
>
> -          Simple query: select * from foo where name like 'a%'

The LIKE operator can be overridden by the application to mean
anything the application wants - it is not compelled to follow
standard SQL semantics.  For that reason, virtual tables are unable to
optimize using LIKE since they have no way of knowing what it will do.

Works as designed.

>
> -          Break inside module BestIndex
>
> -          SQLiteIndex.Inputs.Constraints has 0 length (no constraints)
>
> The above causes a full table scan of the virtual table for queries using
> 'like', which is very bad for any virtual table of a substantial size.
> Virtual tables need to be able to use 'like' clauses to restrict result set
> size.
>
> Before I bug this issue, is anyone aware of it and have any workaround?
> Currently, the only workaround I've got, is telling users don't use 'like'
> in their queries (obviously not a good thing).
>
> Thanks,
> MikeN
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
D. Richard Hipp
drh at sqlite.org

Reply via email to