Igor, On Wed, Nov 13, 2013 at 7:34 PM, Igor Tandetnik <i...@tandetnik.org> wrote: > On 11/13/2013 10:13 PM, Igor Korot wrote: >> >> What I don't understand is: >> >> All fields in WHERE clause are declared as primary/foreign keys. And >> it still gives full table scan on the first iteration. > > > Defining a foreign key doesn't create any indexes, and doesn't in any way > affect the behavior of SELECT statements...
But then in order to speed up this query I need to create an index leaguescorehitter(scoreid), right? Thank you. > > >> Also is it checking conditions from left to right or right to left? > > > Who is checking which conditions? > > >> Meaning the first row in the plan indicate equality against >> scorehits/scorepitch.scoreid, right? > > > The first row in the plan is SCAN TABLE. It visits every row in the table, > regardless of any equality of anything to anything else. > -- > Igor Tandetnik > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users