Indexes in Clusteres

89 views
Skip to first unread message

Lasitha Weerasinghe

unread,
Jul 16, 2015, 1:45:09 AM7/16/15
to orient-...@googlegroups.com
Hi All,

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)

What I want to know is, whether the way I'm querying the records is incorrect or is there a way I can specifically say use that index even when I'm querying from the cluster.

PS: I have rebuild the index also and still the result is same.

Thank you very much,
Lasitha Weerasinghe

l.garulli

unread,
Jul 20, 2015, 3:04:51 PM7/20/15
to orient-...@googlegroups.com, lasith...@gmail.com
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.


Lvc@

Lasitha Weerasinghe

unread,
Jul 21, 2015, 12:04:52 AM7/21/15
to orient-...@googlegroups.com, lasith...@gmail.com
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
Reply all
Reply to author
Forward
0 new messages