#3592: Allowing Q Objects to select between OUTER and INNER joins (semi-
intelligently)
--------------------------------+-------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: mtredinnick
Status: new | Component: Database wrapper
Version: SVN | Resolution:
Keywords: Q,QuerySet,JOINs | Stage: Accepted
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
--------------------------------+-------------------------------------------
Comment (by Michael Radziej <[EMAIL PROTECTED]>):
Replying to [comment:11 [EMAIL PROTECTED]:
A problem with the patch is that it turns every join below the or node
into an outer join. Nested joins, with an outer join at the or node and
inner joins below, would make more sense. I don't know if it would help,
though. The problem is with a table (basically, an association table) with
a few 10k rows. From this table, I get an outer join to another table with
a few 1000 rows. But it's too complex for demonstration.
There's a problem with union: To AND two unions, you'd need INTERSECT. But
mysql 4.1 doesn't have INTERSECT :-(
I cannot explore this further, since I don't have more time for it. I'll
resort to manual sql, once again.
As a general rule, it's hard generate useable SQL in complex cases, and
it's a lot harder to support multiple databases with this. mysql isn't
famous for optimizing complex queries, so solving this in the general case
might really turn out to be impossible for this ***** "database".
Sorry that I cannot offer any more help :-(
--
Ticket URL: <http://code.djangoproject.com/ticket/3592#comment:13>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---