New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
select is using indexes other than lucene even though "lucene" keyword is used #7193
Comments
Hi @scrabb I did a quick debug on this, it seems to be only a problem with the EXPLAIN that reports wrong info. In fact the hash index is never used with LUCENE operator. Thanks Luigi |
Hi @scrabb I just pushed a fix for this on branch 2.2.x Closing, thanks! Luigi |
Hello, I've upgraded to 2.2.18 but i'm still seeing issues with having 2 different types of index on the same attribute. Also, the explain says that it does not use the lucene index in the first query. Any help is much appreciated. Steve |
Hi @scrabb Do you have a dataset to reproduce the issue? I think I'm missing something about your schema and index definitions... Thanks Luigi |
I'm unable to share the dataset due to confidentiality but i'll try and give more details on my schema in an abstract fashion. I have a Vertex with a property called Name. I have a custom index engine based on the HashIndex called ASID. A query like A query like A query like Also note that we do have a hierarchy of classes so Person does have subclasses and each of those has a further 2 indexes of ASID and LUCENE. |
Hi @scrabb Could you please post the result of the following queries:
Thanks Luigi |
I'll send the results of those 4 commands in 4 separate comments |
select from (select expand(classes) from metadata:schema) where name = 'Person' { |
select expand(indexes) from metadata:indexmanager where name like 'Person%' did not return any results, i tried with just select expand(indexes) from metadata:indexmanager and got just 10 results with a mixture of indexes from the subclasses of Person and indexes from other vertices |
Sorry @scrabb I updated the second query, please check my previous comment for the right statement Thanks Luigi |
explain EXPLAIN SELECT FROM Person where Name lucene "Bob" timed out on me (our server has a timeout of 1 minute for all queries). I changed it to explain EXPLAIN SELECT FROM Person where Name lucene "Bob" timeout 5000 return and got { PersonC1 is one of the subclasses of Person. |
explain EXPLAIN SELECT FROM Person where Name = "Bob" { |
select from (select expand(indexes) from metadata:indexmanager) where name like 'Person%' this returned 10 results all from the indexes on the subclasses of Person so i did a minor change to select from (select expand(indexes) from metadata:indexmanager) where name like 'Person.%' Note: I removed the cluster information from this result as the list was really long as there are about 100 subclasses of Person
|
Hi @scrabb What is ASID algorithm? Did you define your own indexing algorithm? Thanks Luigi |
ASID is a custom index engine based on the hash index, i basically have a custom GET and PUT as documented here |
Ok, it explains a lot of things, I'll check the executor and see if there is a problem with custom indexes mixed with Lucene Thanks Luigi |
I also see the same behaviour, I think the most simple scenario to reproduce is having a class with both a unique index (default SBTREE) and a lucene fulltext index on the same parameter (a string of course). Then the query is slowly executed... For context :
|
Im use orientdb-community-2.2.22 on ubuntu 16 and create 2 indexes on same column: (1)full_text_lucene and (2)dictionary or nounuque and have same problem. Im run 2 select: Both select try to use same index and one of its work geopardic slow (thet select do not use index) What index is used depends on the order of their creation. But select from index:class.field key=/lucene val...' ... work fine. It is desirable to use by default full_text index on full_text, full_text_lucene on lucene search(select where) and dictionary index on other search (select where). |
I confirm apapacy's workaround works. |
Hi @clepelli The most efficient way to get records is:
Thanks Luigi |
OrientDB Version: 2.2.17
OS: windows
Expected behavior
I have 2 indexes for the same attribute in a vertex, one is a non unique hash index and the other is a lucene index.
Using a select statement with explain like
EXPLAIN SELECT FROM Person where Name lucene "Bob"
I would expect it to just show that the lucene index was used and not the hash index.
Actual behavior
The explain does not mention the lucene index and only mentions the hash index.
This then has a large impact on the performance of the query.
The text was updated successfully, but these errors were encountered: