232 words

Low performance when getting grove roots

#1
2013-03-28 10:11

Hi,

I have a grove-like structure of objects, every objects referencing its parent. Root objects have null as the value of this parent reference. To find the roots I execute a query. If the number of objects in the tree is significant, this query takes almost forever, it seems ObjectDB loads all objects on the DB to test their parent field value.

Id there a way to force ObjectDB to create an index for this field?

Regards,

Vladimir

tsichevski
tsichevski's picture
Joined on 2013-03-14
User Post #13
#2
2013-03-28 10:31

Of course. Setting indexes is explained in this manual page.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #1,473
#3
2013-03-28 10:32

As I understand, I require having javax.annotation.xxx classes on my classpath even if I do not need them (if I use Hibernate, for example). Are there other ways to configure JDO (not by means of annotations)?

Regards,

Vladimir

tsichevski
tsichevski's picture
Joined on 2013-03-14
User Post #14
#4
2013-03-28 11:03

Done as you suggested. Now the query result is always empty :-(

 

Regards,

Vladimir

tsichevski
tsichevski's picture
Joined on 2013-03-14
User Post #15
#5
2013-03-28 11:53

You can define indexes in an external XML file.

More details would be needed in order to understand the empty results. Does it happen also with a new database file that is created after defining the new index?

Using new indexes with an existing database requires fixing the database using the ObjectDB Doctor.

If you post a test case that demonstrates the problem it should help.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #1,474
#6
2013-03-28 12:24

Yes, it happens on a new database. Moreover, if I comment the @Index line and restart the application with the same DB, I see the original behavior (working but slow).

 

Providing the test case would take some time.

 

Regards,

Vladimir

tsichevski
tsichevski's picture
Joined on 2013-03-14
User Post #16

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel