2
votes

I am evaluating OrientDB.

Created Person class and imported data into it from rdbms. Have about 194k records of person class.

Tried following simple query:

select * from person where FIRST_NAME = 'BOB'

This query gives wrong result. I have 5 persons who have first_name as BOB whereas this query returns only one record.

If I fire following query all 5 records are retrieved (Note I have NOT even used BOB%).

select * from person where FIRST_NAME like 'BOB'

Note that the FIRST_NAME is exactly BOB for all 5 records with no spaces etc.

I am not sure what is going wrong.

Orient DB Version is orientdb-community-2.0.9

1
Seems like indexes are dirty? Could you try rebuilding the index against person.FIRST_NAME ? - Lvca
I also had problems with using LIKE in OrientDB 2.x in a large data set (200k+ records). Takes a while to query, but I solved the problem by indexing stuff with Lucene engine. - AVK
Where did you create this data from? If you used a binary protocol driver I do have some input on why this might happen - masimplo
I used OETL to import data from csv file. I got the issue. Please see below I have answered my own question. - CapsLock

1 Answers

2
votes

Thanks for the comments.

I checked the indexes. I had added DICTIONARY index on FIRST_NAME. After dropping this index my problem was solved.

I am not sure if this is a correct behavior or a bug with orientdb though (Per my knowledge, index should only help with the performance of the query and should not alter the number records a query should return). But yes, this was a DICTIONARY index so I might be wrong.