On Wednesday, May 30, 2012 12:03:02 e.h. Marc L. Allen wrote:
> 1) The left outer join table is joined by a unique column AND
> 2) No other data from the joined table is used in the query.
> 
> Is that about right?

Almost: add "recursively": I actually have it nested with *another join* with 
the same features, both of which can safely be discarded.

And the "unique column" is actually a composite unique constraint.

> 
> Out of curiosity, why is code being written like the SQL you're
> providing?  Is it automatically generated?

It this case, it actually is automatically generated only to keep me from 
having to redundantly write the join over and over again.

A. I have a table of Things.
B. I have a table mapping those Things to object IDs in another datastore.
C. I have a virtual table module exposing that other datastore.

And I have a left outer join between A and B and then another between B and C.

And then I put all of those in one giant (almost: only about 15 columns) view 
that the user can do arbitrary queries on, most of which only touch one or two 
of those columns from C, and many of which touch zero.

There are multiple Bs per A, but one C per B.


> 
> How often does this sort of query come up?

Right now, I want to make this the primary interface to my application, but 
the queries mostly come from users, so one every few seconds.

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

Reply via email to