Re: [sqlite] Question on Indexing

2009-06-01 Thread Jay A. Kreibich
On Mon, Jun 01, 2009 at 12:32:26PM +0200, Ralf scratched on the wall: > Hello, > [>> ] considering a m:n relation a.id <- a.id,b.id -> b.id, is it due to > performance, advisable to put an index on a.id,b.id ? Yes, but very likely not for the reasons you're thinking. In a many-to-many bridge

Re: [sqlite] Question on Indexing

2009-06-01 Thread Kees Nuyt
On Mon, 1 Jun 2009 12:32:26 +0200, "Ralf" wrote: >Hello, >[>> ] considering a m:n relation a.id <- a.id,b.id -> b.id, is it due to >performance, advisable to put an index on a.id,b.id ? a_id,b_id should be unique in the relationship table, so you should make (a_id,b_id) the primary key to enfor

Re: [sqlite] Question on Indexing

2009-06-01 Thread Simon Slavin
On 1 Jun 2009, at 11:32am, Ralf wrote: > [>> ] considering a m:n relation a.id <- a.id,b.id -> b.id, is it > due to > performance, advisable to put an index on a.id,b.id ? Index both fields in your 'middle' file individually unless you expect it to stay very small. The 'id' fields in your o

[sqlite] Question on Indexing

2009-06-01 Thread Ralf
Hello, [>> ] considering a m:n relation a.id <- a.id,b.id -> b.id, is it due to performance, advisable to put an index on a.id,b.id ? Thanks Ralf ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlit