ObjectDB ObjectDB

Difference performance in ObjectDB Explorer and in java project

#1

Hello,

I am learning ObjectDB and i noticed that the queries that are executed in  ObjectDB Explorer are faster (about 5 ms) than queries in my project (~400 ms).

Here is my JPQL query : 

SELECT p FROM Point p WHERE p.x=0

I am using Point entity class from tutorial, but with Indexed "x" field and database contains 999,999 points with random coordinates.

Am i missing something or it is a feature of explorer?

P.S. Two source files are attached.

edit
delete
#2

Queries are executed in the Explorer in a special lazy mode, which is faster in returning the results, but requires further round-trips to fetch related data.

You can try it also from your program:

    query.setHint("objectdb.result-fetch", "LAZY");
ObjectDB Support
edit
delete
#3

Thank you, is where any other useful hints for object db? Performance is better, but still not the same 1000 ms in my project and about 300 ms in explorer

edit
delete
#4

See this manual page regarding the query hints.

If your classes are not enhanced then try enhancing them.

ObjectDB Support
edit
delete
#5

Appreciate your help

edit
delete

Reply

To post on this website please sign in.