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
Indexes not working when querying inside the cluster #4606
Comments
Same post as here. https://groups.google.com/forum/#!topic/orient-database/iET3x8xoeWY Scott |
Indexes works at class level, not index level. We're working to a new spec to allow this, but right now this isn't supported, sorry. You could rather create multiple classes by using inheritance and in this case each class would have own index. |
You mean indexes work at class level and not at cluster level, correct? Scott |
Thank you vary much for the Reply Lvca, People would love to have that as an feature. So please try to implement that in the future. Lasitha Weerasinghe |
@lvca - mentioning you to (politely) get your attention to the question I asked above. I'm sorry, but I didn't understand your answer completely. Scott |
@smolinari which part of the answer? How to use inheritance? |
@lvca: If I understand this right, are you saying that ODB won't/can't use an index on a clustered class (without the inheritance approach)? If so, I'd love to see an example of how inheritance would make this work. |
According to my understanding he is referring to something like this. In my above mentioned scenario, instead of creating a cluster named as A_1, I have to create a new class A_1, inherited from class A. Then the indexes I have created for Class A will be inherited to class A_1 also. (And even I can create specific indexes for the A_1 class also.) So when I'm retrieving data I can query like "select from A_1 where ..." and this query will use the indexes created for class A and also for the Class A_1. |
@lvca - you said this.
and I asked this
I am not sure what you meant with "index level", if that is what you meant to say. Scott |
Hi Scott, yes, I guess it was just a typo ;-) Luigi 2015-07-22 6:43 GMT+02:00 Scott notifications@github.com:
|
Thanks Luigi. |
I'm using document type database in Orientdb 2.0.3.
I have a class A which has an field attr1 and I have created NOTUNIQUE_HASH_INDEX index on that attr1.
Recently I have clustered class A into few clusters named A_1, A_2, A_3 ...
After that when I'm querying for a record in Class A I have noticed the following:
if I execute a query like this,
select from A where attr1 = #10:111 AND ...
it uses the index on attr1 and do document reads around 1500 (which gives results pretty fast)
But if I execute a query like this,
select from cluster:A_1 where attr1 = #10:111 AND ...
it does not use the index on attr1 and do document reads around 14000 (which is the number of records in that cluster)
Note: I have rebuild the index also and still the result is same.
Is this a bug or a feature??
The text was updated successfully, but these errors were encountered: