On Sun, Mar 13, 2011 at 10:31 AM, Igor Tandetnik <itandet...@mvps.org> wrote:
> Garry Watkins <ga...@dynafocus.com> wrote:
>> Not sure why you are using a subselect with a union all.
>>
>> SELECT *
>>  FROM multiturnTable
>> WHERE (player1 ='?' OR player2 ='?')
>
> Because OR prevents SQLite from using an index on either player1 or player2, 
> and turns the query into full table scan.

Recent releases can optimize ORs into UNION ALLs.

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

Reply via email to