On Fri, Aug 6, 2010 at 5:23 AM, Edward Hawke <edhawk...@googlemail.com>wrote:

>
> I have done an EXPLAIN QUERY PLAN on the query, which gave me the
> following:
>
> "0","2","TABLE Tour"
> "1","4","TABLE Country"
> "2","1","TABLE Match"
> "3","11","TABLE Team AS BowlingTeam"
> "4","12","TABLE Team AS BattingTeam"
> "5","13","TABLE Team AS HomeTeam"
> "6","14","TABLE Team AS AwayTeam"
> "7","3","TABLE Ground"
> "8","8","TABLE Player AS Bowler"
> "9","9","TABLE Player AS Batsman"
> "10","10","TABLE Player AS Partner"
> "11","5","TABLE PlayerTeam AS BowlerPT"
> "12","6","TABLE PlayerTeam AS BatsmanPT"
> "13","0","TABLE Delivery VIA MULTI-INDEX UNION"
> "14","7","TABLE PlayerTeam AS PartnerPT"
> "0","0","TABLE Delivery WITH INDEX Delivery_BatsmanPTIdx"
> "0","0","TABLE Delivery WITH INDEX sqlite_autoindex_Delivery_1"
>
> But I am unsure on how to read this, and what information it is giving me
> about how to better select my indices.
>

What this shows us is that, except for the subqueries on the Delivery table,
you are not using any indices anywhere.  As far as this query is concerned,
you might as well not have any indices on any of your tables other than
Delivery.

You can start by adding indices on terms that appear on either side of an =
in your WHERE clause.  The whole story is rather more complex, but that will
be a good start.


-- 
---------------------
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to