Kurt Welgehausen wrote:

Currently, indices are not used to look up either term
in an OR expression.

See <http://www.sqlite.org/php2004/page-052.html>.

You could build 2 separate 5-column indices and use a
union.

Regards

his is not true. databases split usually queries into several sub queres, if you use an OR clause in the middle of indexed fields. I don't know, if sqlite is doing somelike things.

As example, imagine you have two fields in an index (field1, field2)

select field1, field2 where field1 = 'value' and (field2 = 'value1' or field2 = 'value2')

the database will start two subqueris and make a unique union of both results:

select field1, field2 where field1 = 'value' and field2 = 'value1'
select field1, field2 where field1 = 'value' and field2 = 'value2'


--
Try Code-Navigator on http://www.codenav.com
a source code navigating, analysis and developing tool.
It supports following languages:
   * C/C++
   * Java
   * .NET (including CSharp, VB.Net and other .NET components)
   * Classic Visual Basic
   * PHP, HTML, XML, ASP, CSS
   * Tcl/Tk,
   * Perl
   * Python
   * SQL,
   * m4 Preprocessor
   * Cobol

Reply via email to