Il 02/07/2016 05:44, Luca Garulli ha scritto:
> Did you create an INDEX (non hash) against demo.age and an HASH_INDEX
> against drugname?

I have tried to use out() instead of in() in OrientDB query and time
execution are better, but if I add indexes yet in MySQL schema execution
times in MySQL remains better than OrientDB.

First example (2 tables join):

select count(*) as total from ( select expand(out()) from drug where
drugname = 'TRIZIVIR' ) where age > 29 and age < 46

requires 1.698 sec in OrientDB.

Equivalent query in MySQL:

select count(*) as total from drug, demo where drug.primaryid =
demo.primaryid and demo.age > 29 and demo.age < 46 and drug.drugname =
'TRIZIVIR'

requires less than 0.01 sec.

Second example (3 tables join):

select count(*) as total from ( select expand(out()) from ( select
expand(out()) from indi where indi_pt = 'HIV infection' ) where drugname
= 'TRIZIVIR' ) where age > 29 and age < 46

requires 80.66 sec in OrientDB.

Equivalent query in MySQL:

select count(*) as total from indi, drug, demo where indi.primaryid =
drug.primaryid and indi.indi_drug_seq = drug.drug_seq and drug.primaryid
= demo.primaryid and indi.indi_pt = 'HIV infection' and drug.drugname =
'TRIZIVIR' and demo.age > 29 and demo.age < 46;

require also less than 0.01 sec.

-- 
Fabio Rinnone
Skype: fabiorinnone
Web: http://www.fabiorinnone.eu

-- 

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

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to