Hi,

I am using OrientDB 2.1.8 on Windows 2012 server platform. I have a table 
about 1.117.549 records, with indices as following. 
<https://lh3.googleusercontent.com/-hM1EdHHJZxk/VzMRQ5Zk0WI/AAAAAAAAHb4/iVjpFgKwZUQ4EkIGj6L_yDQZ4YogRwydgCLcB/s1600/2016-05-11_13h02_09.png>


Here are some queries and its timing captured from OrientDB Studio.

(this is the query I need to speed up)

SELECT FROM Contact WHERE (OwnedBy.EntityInfo.State <> 200) AND (Account = 
#20:2) AND (EntityInfo.State = 0) ORDER BY EmailAddress ASC skip 10 limit 10
=> it took 6.356 sec.

SELECT FROM Contact WHERE (Account = #20:2) AND (EntityInfo.State = 0) 
ORDER BY EmailAddress ASC skip 10 limit 10
=> it took 4.781 sec.

SELECT FROM Contact WHERE (OwnedBy.EntityInfo.State <> 200) AND 
(EntityInfo.State 
= 0) ORDER BY EmailAddress ASC skip 10 limit 10
=> it took 0.236 sec.

SELECT FROM Contact WHERE (OwnedBy.EntityInfo.State <> 200) AND (Account = 
#20:2) AND (EntityInfo.State = 0) skip 10 limit 10
=> it took 0.074 sec.

As you see the result, the WHERE on Account cause a poor performance. If I 
remove ORDER BY EmailAddress and do a EXPLAIN, index Contact.Account is 
used and query speeds up.
What do I need to do to speed up this query? Any help will be very 
appreciated.

My Best, 
Hung Tran

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to