100% CPU when using multiple BETWEEN

#1

Hi,

we are evaluating ObjectDB 2.5.1_03 in embedded mode.

We have a DB of about 2800 instances of a class that has two java.lang.String members: toExtension and fromExtension. There are other members in the class, but not relevant to the problem.

 

A query like this causes the java process to start running at 100% CPU (endless loop) and it never recovers:

SELECT r from RecordingMetaData AS r
WHERE (((r.toExtension BETWEEN '2010' AND '2099') OR
        (r.toExtension BETWEEN '2001' AND '2002')) OR
        ((r.fromExtension BETWEEN '2010' AND '2099') OR
         (r.fromExtension BETWEEN '2001' AND '2002')))
ORDER BY r.startDate DESC, r.startTime DESC, r.channelNumber DESC

 

The following query works fine (sub second response):

SELECT r from RecordingMetaData AS r
WHERE (((r.toExtension BETWEEN '2010' AND '2099')) OR
       ((r.fromExtension BETWEEN '2010' AND '2099')))
ORDER BY r.startDate DESC, r.startTime DESC, r.channelNumber DESC

 

In both cases we limit the result count to the first 50 records with Query.setMaxResults(...).

 

Any suggestions?

Thank you

Emil

 

#2

In addition to the above description of the problem:

We left a problem query to run. The query never complets, however, the Java thread that runs the query eventually (after 18 minutes or so on DB with 2800 records) throws a "java.lang.OutOfMemoryError: Java heap space" exception.

Emil

#3

We have to reproduce this in order to understand the bug and fix it.

Could you share your test database so we would be able to run this query in the Explorer?

ObjectDB Support
#4

You can download from: http://www.prolancer.com.au/download/objectdb/SystemDB.odb

It is a 1GB file.

Best regards

Emil

#5

Thanks. Download is very slow and could take many hours.

Could you please provide a compressed (zip) version of this file?

ObjectDB Support
#6

Download failed several times.

Could you please upload the file (in a zip format) to our FTP server:

Host: objectdb.com, Username: public, Password: public

ObjectDB Support
#7

On your FTP server now as SystemDB.zip. We created much smaller file with the same data. The problem is still present with the smaller DB file.

Emil

#8

Thank you for your report. Build 2.5.1_04 should fix this issue.

ObjectDB Support
#9

I can confirm that the problem does not appear to be present in 2.5.1_04. Thank you very much for your quick response on this issue.

Best regards

Emil

Reply