The Artima Developer Community
Sponsored Link •

Java Answers Forum
KODO JDO performance

1 reply on 1 page. Most recent reply: Nov 20, 2004 6:30 AM by Neelan Choksi

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
tamarkl

Posts: 1
Nickname: tamarkl
Registered: Nov, 2004

KODO JDO performance Posted: Nov 8, 2004 11:07 PM
Reply to this message Reply
Advertisement
I'm trying to use KODO JDO and found an interesting phenomenon.I would like to understand why it happend.
I have four mapped classes that each of their instances can be related or to an instance of the same class or to the next class.(this four classes can be understood as a tree structure - as following (for classes a,b,c,d) the instances may be related as following -
a1(a2(a5(b4(b6,c1(c2(d2(d5(d7),d6),d3),c3,d1)),b5),b1,b2),a3(a6,a7,b3),a4)
The big question is the way I should map the objects, should I define a collection of the children in each parent or should I put only the 'parent' field in each child (and get the children when needed by a queries).
I tried that and found that the first way (map collections of the children) was significantly better.
I test the case by getting all the children from the highest level to the lowest and got (5532 msec in the first option and in the second I got the answers in 12375 msec - I write here the performance for the first time check, after that the cache 'helped' the performance).
The way I did that for the first option was just to get the attribute of the children collection, get the children of the highest level parent and then get the children's children ect.(I think that all the children levels were already populated after the highest parent was fetched?!)
The way I did that for the second option was query recursively the children by the (parent = 'x').
Why did I get such a difference between those cases. I thought that the queries performance should be the same as having mapped collections of children - after all teh same sqls should be performed, isn't that true?! how can I explain the difference in the performance?


Neelan Choksi

Posts: 1
Nickname: neelan
Registered: Jun, 2004

Re: KODO JDO performance Posted: Nov 20, 2004 6:30 AM
Reply to this message Reply
The SQL will not be the same as each depth in the tree requires another join. This is one of the major limitations of relational databases, that each relation requires another join regardless of being the same (sub) class. However, Kodo can more eagerly fetch this depth based on EagerFetchMode settings as well as your metadata.

For faster response times to Kodo specific queries, you can also contact our engineering staff directly at
jdosupport@solarmetric.com.

Best Regards,
Neelan Choksi
neelan@solarmetric.com

Flat View: This topic has 1 reply on 1 page
Topic: Whats wrong with this java code! can anyone help? Previous Topic   Next Topic Topic: setting window in exact position in stack

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use