|
|
|
Supreme Being
      
Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230,
Visits: 1 382
|
|
You will get the better performing SQL if you use the better performing OCL-statement.
Malcolm is a good guy, but he was never in a position where he could promise features in ECO...
The problem is not so much to being able to configure whether a particular database supports subselects (MySql4 doesn't do that either), but to optimize the query to avoid them. I understand that it looks obvious to the naked eye that the query is optimizeable, and that there is a really short and natural way of writing it in SQL. The problem doesn't look quite as easy when you have a parse-tree in OCL that you need to convert to the semantically equivalent SQL...
/Jonas Hogstrom [CapableObjects]
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 2010-08-11 16:02:44
Posts: 338,
Visits: 890
|
|
Jonas Hogstrom (2008-11-28) The problem doesn't look quite as easy when you have a parse-tree in OCL that you need to convert to the semantically equivalent SQL...
But maybe it would be possible to introduce some mapping so that query that matches pattern (for example) "[ClassA].allInstances->select([AtoB] = [self])" would execute custom SQL?
Pattern: "[ClassA].allInstances->select([AtoB] = [inst])"
Params: ClassA=Class(ClassA), AtoB=Association(ClassA.AtoB), inst=self
SQL: select * from ClassA where AtoB = @inst
Or define it some other way (maybe in XML as a parse-tree).
This way we could add number of mapping items to optimaise queries.
Cheers.
My Blog: http://dnagir.blogspot.com
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 2010-08-11 16:02:44
Posts: 338,
Visits: 890
|
|
Can you please let us know if in the future release you will allow us to customise the SQL that our applications send to the database.
Some sort of OCL - SQL mapping could be provided to all a developer to take full control and responsibility.
Please let us know if you will implement such feature or not.
My Blog: http://dnagir.blogspot.com
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 2012-01-23 17:45:58
Posts: 49,
Visits: 72
|
|
| I vote for your suggestion!
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230,
Visits: 1 382
|
|
it might look really easy, but there are so many cases where this simple approach will get you nowhere (compound keys, associations in an inherited table, remapped column names, associations embedded in the other end).
To solve this simple case, it is easier to build your own service from scratch. load the primary key and use the ICacheContentService to convert the keys to objects.
/Jonas Hogstrom [CapableObjects]
|
|
|
|