[CDO] Can CDOView#queryInstances limit results by CDOResource? [message #1722254] |
Wed, 03 February 2016 15:39 |
|
Hi all,
In our integration between CDO and Epsilon, we've started to use CDOView#queryInstances as it can provide some nice performance increases in some cases: it's much better than iterating through the resource.
However, we've noticed that it returns all the instances in the whole repository and not just the instances in the CDOResource we're working with. If we have 2 instances of X in /f.xmi and 1 in /g.xmi, and we've specified that we want to work on /input.xmi, we'd like to only see 2 instances and not 3.
Is there any way to limit its scope? So far we're limiting it on the client, but it'd be nice if the server never sent that unwanted object anyway.
Kind regards,
Antonio
|
|
|
Re: [CDO] Can CDOView#queryInstances limit results by CDOResource? [message #1722258 is a reply to message #1722254] |
Wed, 03 February 2016 15:52 |
|
Am 03.02.2016 um 16:40 schrieb Antonio Garcia-Dominguez:
> Hi all,
>
> In our integration between CDO and Epsilon, we've started to use CDOView#queryInstances as it can provide some nice
> performance increases in some cases: it's much better than iterating through the resource.
Yes, although iteration can be optimized by prefetching, e.g.:
cdoResource.cdoPrefetch(CDORevision.DEPTH_INFINITE);
>
> However, we've noticed that it returns all the instances in the whole repository and not just the instances in the
> CDOResource we're working with.
Yes.
> If we have 2 instances of X in /f.xmi and 1 in /g.xmi, and we've specified that we want to work on /input.xmi, we'd
> like to only see 2 instances and not 3.
I'm not sure how /input.xmi relates to /f.xmi, but I guess you mean the same thing?
>
> Is there any way to limit its scope? So far we're limiting it on the client, but it'd be nice if the server never sent
> that unwanted object anyway.
No, there's currently no way to limit the results to only those that are contained by some scope object. Generally the
computation "is object X contained by object Y?" involves visiting all parents of X up to either Y or the root resource.
That's quite expensive, so we've almost nowhere provided such scoping. Given that it would be optional here and if
you're willing to provide a patch, we could consider adding such scoping.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [CDO] Can CDOView#queryInstances limit results by CDOResource? [message #1722268 is a reply to message #1722258] |
Wed, 03 February 2016 16:30 |
|
Yes, we tried prefetching and it didn't work as well (we only need a very small subset of a reasonably large model). Using a packet sniffer to watch the TCP connection, we measured ~50MB doing iteration + prefetching and 211kB with queryInstances.
And also yes, I meant /f.xmi and not /input.xmi . Sorry for the slip.
Thanks for the info! We'll see if we can provide a patch once the schedule clears up a bit.
|
|
|
Powered by
FUDForum. Page generated in 0.03398 seconds