Re: [sqlite] Foreign Keys and Indexes

2009-05-28 Thread s . breitholz
> s.breith...@staubli.com wrote: > > So when I have a query over serveral tables normally the primay key > > is set as index when the table is joined. > > Only if you actually join on primary key column(s). Doing so is common, > but not mandatory. > > > If I need to add a where > > clause > > to

Re: [sqlite] Foreign Keys and Indexes

2009-05-27 Thread Igor Tandetnik
s.breith...@staubli.com wrote: > So when I have a query over serveral tables normally the primay key > is set as index when the table is joined. Only if you actually join on primary key column(s). Doing so is common, but not mandatory. > If I need to add a where > clause > to a field of the join

Re: [sqlite] Foreign Keys and Indexes

2009-05-27 Thread s . breitholz
> s.breith...@staubli.com wrote: > > Now I noticed that the speed of selects are much faster with fields > > that are indexed > > Well, that's pretty much the point of having an index in the first > place. Why do you find this fact surprising? Because the indexed field that improved my program w

Re: [sqlite] Foreign Keys and Indexes

2009-05-27 Thread Igor Tandetnik
s.breith...@staubli.com wrote: > Now I noticed that the speed of selects are much faster with fields > that are indexed Well, that's pretty much the point of having an index in the first place. Why do you find this fact surprising? > I´ve read that only one index is used per where (I think join

[sqlite] Foreign Keys and Indexes

2009-05-27 Thread s . breitholz
As Sqlite does not support foreign keys with all features I just declared the fields as Integer. Now I noticed that the speed of selects are much faster with fields that are indexed, I wonder whether this was a good idea. (Silly university education, I´ve learned much about sql but nothing abou