Hi,
I have a 12GB database with 787603 entries.
It is much larger than usual and there are performances issues.
I am doing small queries and they take much longer than I expect, i.e.:
Get the total number of entries
Get 25 consecutive entries (i.e. 0-25)
Get one specific entry
On average each query needs 4 to 5 minutes to return a result.
I have been adviced to use indexes but they are already used through the JDO Metadata file.
For instance I use this class:
public class MessageImpl implements Message, LogItem, Comparable {
private int Id;
private int logTestRunId;
private int logEntryId;
private String sendingNodeId;
private String receivingNodeId;
private Date timeStamp;
private String messageName;
private String messageDetail;
private transient LogTestRunImpl logTestRun;
private transient LogEntryImpl logEntryImpl;
...
And I use such query:
Query query = pm.newQuery(MessageImpl.class,
"this.logTestRunId == " + logTestRun.getId());
query.setOrdering("this.Id ascending");
The package.jdo contains for this class:
<class name="MessageImpl">
<extension vendor-name="objectdb" key="unique-index" value="Id"/>
<extension vendor-name="objectdb" key="index" value="logTestRunId"/>
<extension vendor-name="objectdb" key="index" value="logEntryId"/>
</class>
I profiled the application and ObjectDB calls on RandomAccessFile.readFully and I have been told that because ObjectDB have to scan the entire database file and is not using indexes.
Therefore I think I am not doing something wrong. Any idea what the problem is?
Thanks.