Home » Modeling » EMF » [CDO] Increase prepared statement fetch size in DB Store  
| [CDO] Increase prepared statement fetch size in DB Store  [message #1386362] | 
Tue, 17 June 2014 02:03   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hello! 
 
I wonder, if there is any way to configure CDO Db Store, to use user-specified fetch size for it's prepares statements? 
 
I've into a major performance problem with OCL, where calling  
SomeClass.allInstances() -> select(predicate)
  
was almost always leading to signal time out. After some profiling i've discovered that the problem lies into org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.handleRevisions(IDBStoreAccessor, CDOBranch, long, boolean, CDORevisionHandler). 
 
ResultSet size there is almost 300,000 elements, which is perfectly fine, since it only contains CDOIDs, but result set iteration is extremely slow, due to a low fetch size. 
 
I've measured the performance by performing the same query, on the same DB with different fetch sizes, and here is the result: 
 
Quering 300,000 CDOIDs:
FetchSize/Time to iterate (ms)
10/38,580
100/2,918
1,000/1,196
5,000/600
10,000/530
20,000/521
100,000/406
  
 
I haven't find any way to configure fetch size in CDO Db Store. Is there any?  
 
Thanks in advance!
 |  
 |  
  |  
| Re: [CDO] Increase prepared statement fetch size in DB Store [message #1386409 is a reply to message #1386362] | 
Tue, 17 June 2014 07:29    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
On 17-06-14 08:03, Leonid Ripeynih wrote: 
> Hello! 
> 
> I wonder, if there is any way to configure CDO Db Store, to use 
> user-specified fetch size for it's prepares statements? 
Have you checked out this? 
 
http://wiki.eclipse.org/CDO/Tweaking_Performance 
 
 
> 
> I've into a major performance problem with OCL, where calling 
> SomeClass.allInstances() -> select(predicate) 
> 
> was almost always leading to signal time out. After some profiling i've 
> discovered that the problem lies into 
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.handleRevisions(IDBStoreAccessor, 
> CDOBranch, long, boolean, CDORevisionHandler). 
> 
> ResultSet size there is almost 300,000 elements, which is perfectly 
> fine, since it only contains CDOIDs, but result set iteration is 
> extremely slow, due to a low fetch size. 
> 
> I've measured the performance by performing the same query, on the same 
> DB with different fetch sizes, and here is the result: 
> 
> 
> Quering 300,000 CDOIDs: 
> FetchSize/Time to iterate (ms) 
> 10/38,580 
> 100/2,918 
> 1,000/1,196 
> 5,000/600 
> 10,000/530 
> 20,000/521 
> 100,000/406 
> 
> 
> I haven't find any way to configure fetch size in CDO Db Store. Is there 
> any? 
> Thanks in advance!
 |  
 |  
  |   |  
| Re: [CDO] Increase prepared statement fetch size in DB Store [message #1386538 is a reply to message #1386439] | 
Wed, 18 June 2014 04:05   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
In my case the problem was that everything was fetched. This means, as soon as the iterator started it should run fast. 
 
I don't know how the OCL-statement internally works: 
SomeClass.allInstances() -> select(predicate)
  
But further more the CDOServerExporter uses repository.handleRevisions. This really streams all data from some stored EClasses. 
 
The default procedure for fetching revisions works differently.
[Updated on: Wed, 18 June 2014 04:06] by Moderator  
 |  
 |  
  |   
Goto Forum:
 
 Current Time: Mon Nov 03 19:06:02 EST 2025 
 Powered by  FUDForum. Page generated in 0.03513 seconds  
 |