Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] OCL Query to sql(How the query result is generated?)
[CDO] OCL Query to sql [message #988932] Mon, 03 December 2012 20:46 Go to next message
Michele Preti is currently offline Michele PretiFriend
Messages: 14
Registered: October 2012
Junior Member
Hi, i'm trying to figure out if CDO suit my needs, and i have writ a simple test, for now the topic is Queries.
I really like the idea of using OCL as and abstracted language indipendent from the DBStore but when i have tryed to find the sqlQuery corresponding to my OCL query in the trace file i can't find it.

Now i have the doubt that OCL didn't convert to sql but instead load all objects in memory and apply the constraints. Am i right?

My OCL query was "Foo.allInstances()->select(f:Foo|f.xyz='test')" but in the trace file there is no a where clause with xyz = 'test' (or something like). At least...can't find it.
Re: [CDO] OCL Query to sql [message #988972 is a reply to message #988932] Tue, 04 December 2012 06:31 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 03.12.2012 21:46, schrieb Michele Preti:
> Hi, i'm trying to figure out if CDO suit my needs, and i have writ a simple test, for now the topic is Queries.
> I really like the idea of using OCL as and abstracted language indipendent from the DBStore but when i have tryed to
> find the sqlQuery corresponding to my OCL query in the trace file i can't find it.
>
> Now i have the doubt that OCL didn't convert to sql but instead load all objects in memory and apply the constraints.
> Am i right?
>
> My OCL query was "Foo.allInstances()->select(f:Foo|f.xyz='test')" but in the trace file there is no a where clause
> with xyz = 'test' (or something like). At least...can't find it.
You're right, CDO does not translate OCL to SQL. It integrates with OCL at the "extents map" level, where it provides
lazy extents.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] OCL Query to sql [message #989022 is a reply to message #988972] Tue, 04 December 2012 10:46 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Istvan Rath has done performance benchmarks that demonstrate that
provided the server memory is large enough the direct OCL approach is an
order of magnitude faster than SQL.
http://www.eclipse.org/modeling/mdt/ocl/docs/publications/EclipseConEurope2012/FastQueries.pdf
slide 5 for a quick result. See Istvan's publications for extensive
results and descriptions.

Regards

Ed Willink



On 04/12/2012 06:31, Eike Stepper wrote:
> Am 03.12.2012 21:46, schrieb Michele Preti:
>> Hi, i'm trying to figure out if CDO suit my needs, and i have writ a
>> simple test, for now the topic is Queries.
>> I really like the idea of using OCL as and abstracted language
>> indipendent from the DBStore but when i have tryed to find the
>> sqlQuery corresponding to my OCL query in the trace file i can't find
>> it.
>>
>> Now i have the doubt that OCL didn't convert to sql but instead load
>> all objects in memory and apply the constraints. Am i right?
>>
>> My OCL query was "Foo.allInstances()->select(f:Foo|f.xyz='test')" but
>> in the trace file there is no a where clause with xyz = 'test' (or
>> something like). At least...can't find it.
> You're right, CDO does not translate OCL to SQL. It integrates with
> OCL at the "extents map" level, where it provides lazy extents.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
Previous Topic:[CDO] get deleted Revision/CDOObject
Next Topic:[CDO] ClassCastException when removing one entry from the model
Goto Forum:
  


Current Time: Fri Mar 29 10:00:57 GMT 2024

Powered by FUDForum. Page generated in 0.02458 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top