Issue Details (XML | Word | Printable)

Key: NUCRDBMS-368
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

JDOQL2 : Improve the logic for determining when to use INNER JOIN or EXISTS for a containsXXX clause

Created: 16/Apr/10 01:25 PM   Updated: 10/Dec/10 07:49 AM   Resolved: 16/Nov/10 06:17 PM
Component/s: Queries
Affects Version/s: None
Fix Version/s: 2.2.0.release


 Description  « Hide
Currently we do a simple check on the filter ... is there a NOT or an OR in the filter and if so use EXISTS, otherwise use INNER JOIN.

What we ought to do is extend this further and see if the only use of OR is using that same variable

e.g a query like
collField.contains(var) && (var.name == :val1 || var.name == :val2)

would use EXISTS currently, but could reasonable use INNER JOIN

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 16/Nov/10 03:47 PM
User can now define the query extension
datanucleus.query.jdoql.{varName}.join
as either "SUBQUERY" or "INNERJOIN" and this will control how the contains is handled (i.e same syntax as used in some 1-1 relations)

Andy Jefferson added a comment - 16/Nov/10 06:17 PM
Bearing in mind the situations where we should use a subquery, or where we should use INNER JOIN are very hard to define, I'm leaving this til a later release to define further. The user now has a workaround of specifying the link method via query extension