Hi there,
I'm yet a bit confused about differences beetween relational model and
graph database model. I have imported into OrientDB graph a relational
database but I'm not sure if my approach to query graph data is correct.
For instance, I use the following query with 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'
Is this following OrientDB query equivalent in OrientDB?
select count(*) as total from ( select expand(in()) from demo where age
> 29 and age < 46 ) where drugname = 'TRIZIVIR'
In this case I'm using a subquery: do you think is it more slowly than
using a join?
In this case, first query require 1 min 46.15 sec and the second one
127.496 sec(s). I think it is not a good result.
I yet don't understand if using of 'traverse' into 'select' is more
efficient than using of 'expand' and I don't understand how can I use
'dot notation' to query data, if possible.
I have imported graph database using Java Graph API: when I found some
value for foreign keys (in this case primaryid) I have created an edge
beetween vertices founded as follow:
graph.addEdge(null, sourceVertex, targetVertex, "E");
I'm using lightweighted edges.
I'm not sure but I think I can't use 'dot notation' because fields
(primaryid in this case) are not mapped somehow, right?. I have tried to
use in_ and out_ properties in query but I have no success.
Can you explain what is my issue?
--
Fabio Rinnone
Skype: fabiorinnone
Web:
http://www.fabiorinnone.eu