Is there any general recommendation how to speed up queries? 

My query is 
select count(*) from V where class_name = 'VicClet' AND Deleted = 0 AND 
DocNumber = '1111-222-PP' 

I have about 500 000 vertices and this query returns about 50 000, but it 
lasts about 15 secs!  Where is that speed that OrientDB is "famous" for? 



On Wednesday, 22 October 2014 08:14:42 UTC+2, Luigi Dell'Aquila wrote:
>
> Hi,
>
> no, M2 is not the latest snapshot.
> You can find it here
>
>
> https://oss.sonatype.org/content/repositories/snapshots/com/orientechnologies/orientdb-community/2.0-SNAPSHOT/
>
> Luigi
>
>
>
> 2014-10-21 21:15 GMT+02:00 Kanak Agarwal <[email protected] 
> <javascript:>>:
>
>> Hi
>>
>> Thanks for the response. I am seeing the issue in the OrientDB 2.0-M2 
>> community edition. 
>> Is this the latest SNAPSHOT?
>>
>>
>> On Tuesday, October 21, 2014 2:23:04 AM UTC-5, Luigi Dell'Aquila wrote:
>>>
>>> Hi,
>>>
>>> what version of OrientDB are you using? We had two issues related to OR 
>>> operators and index usage:
>>>
>>> https://github.com/orientechnologies/orientdb/issues/2898
>>> https://github.com/orientechnologies/orientdb/issues/2893
>>>
>>> and we fixed them some days ago.
>>> Could you try again on latest SNAPSHOT?
>>>
>>> thanks
>>>
>>> Luigi
>>>
>>>
>>>
>>> 2014-10-20 19:53 GMT+02:00 Kanak Agarwal <[email protected]>:
>>>
>>>> Hello
>>>>
>>>> My V class contains two properties prop1 and prop2 both of which are 
>>>> indexed using non unique hash index.
>>>> The queries on prop1 alone (select from V where prop1 = 'xyz') or prop2 
>>>> alone (select from V where prop1 = 'abc') use the index and perform well.
>>>> On the other hand, a query that uses OR in the WHERE clause (select 
>>>> from V where prop1 = 'xyz' OR prop2 = abc') is very slow - it's not using 
>>>> index and seems to be doing linear scan.
>>>> Any suggestions on how to optimize this query.
>>>>
>>>>
>>>> Here are the SQL explain results
>>>> - prop1 query (select from V where prop1 = 'xyz')
>>>>
>>>> [{"@type":"d","limit":-1,"compositeIndexUsed":1,"
>>>> involvedIndexes":["V.prop1"],"fullySortedByIndex":false,"
>>>> indexIsUsedInOrderBy":false,"current":"#9:20000","evaluated":20,"
>>>> fetchingFromTargetElapsed":0,"documentReads":20,"
>>>> documentAnalyzedCompatibleClass":20,"recordReads":20,"
>>>> elapsed":0.216,"resultType":"collection","resultSize":20,"@
>>>> rid":"#-1:-1"}]
>>>>
>>>> - prop2 query (select from V where prop2 = 'abc')
>>>>
>>>> [{"@type":"d","limit":-1,"compositeIndexUsed":1,"
>>>> involvedIndexes":["V.prop2"],"fullySortedByIndex":false,"
>>>> indexIsUsedInOrderBy":false,"current":"#9:20025","evaluated":20,"
>>>> fetchingFromTargetElapsed":0,"documentReads":20,"
>>>> documentAnalyzedCompatibleClass":20,"recordReads":20,"
>>>> elapsed":0.208,"resultType":"collection","resultSize":20,"@
>>>> rid":"#-1:-1"}]
>>>>
>>>> - prop1 or prop2 query (select from V where prop1 = 'xyz' or prop2 = 
>>>> 'abc')
>>>>
>>>> [{"@type":"d","current":"#9:39999","evaluated":40000,"
>>>> fetchingFromTargetElapsed":249,"documentReads":40000,"
>>>> documentAnalyzedCompatibleClass":40000,"recordReads":40000,"
>>>> elapsed":249.68301,"resultType":"collection","
>>>> resultSize":40,"@rid":"#-1:-1"}]
>>>>
>>>>  -- 
>>>>
>>>> --- 
>>>> 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.
>>>>
>>>
>>>  -- 
>>
>> --- 
>> 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] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 

--- 
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