ObjectDB ObjectDB

Low performance when getting grove roots

#1

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

edit
delete
#2

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

ObjectDB Support
edit
delete
#3

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

edit
delete
#4

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

 

Regards,

Vladimir

edit
delete
#5

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
edit
delete
#6

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

edit
delete

Reply

To post on this website please sign in.