Hi SavioL,

It's not Ziink was asking it's me.
Thanks a lot for your answer, I'll try it shortly. This is quite a work 
you've done right there, I do appreciate it.

I have concerns regarding performance of this query on large sets of data...
And I still need to add one tweak, I don't know how many other vertices V1 
is connected to (either by in or out connection). So I need to traverse ALL 
its connection and calculate those number for each found vertex that is 
connected to some V1.

I was hoping to get any input from orientdb devs on this, unfortunately 
they keep being unresponsive.

On Wednesday, June 3, 2015 at 10:00:10 AM UTC-4, SavioL wrote:
>
> Hi Ziink,
>
> the result you were looking for, is return with (not easy:) query:
>
> select name, sum from (select expand($totale) 
> let $v2 = (select name, sum(sum) from (
> select expand($c) let $a = (select name, sum(count) from (select name, 
> count(*) from (select expand(out("Related")) from Vertex where name="V1") 
> group by name) group by name ), $b = (select name, sum(count) from (select 
> name, count(*) from (select expand(in("Related")) from Vertex where 
> name="V1") group by name) group by name ), $c = unionAll( $a, $b ) ) where 
> name = "V2"), 
> $v3 = (select name, sum(sum) from (
> select expand($c) let $a = (select name, sum(count) from (select name, 
> count(*) from (select expand(out("Related")) from Vertex where name="V1") 
> group by name) group by name ), $b = (select name, sum(count) from (select 
> name, count(*) from (select expand(in("Related")) from Vertex where 
> name="V1") group by name) group by name ), $c = unionAll( $a, $b ) ) where 
> name = "V3"), 
> $totale = unionAll( $v2, $v3 ))
>
> the result is:
>
>
> <https://lh3.googleusercontent.com/-g9Ea-V_QuQM/VW8HrsnqigI/AAAAAAAAABY/gxgIbnvBz-g/s1600/somma%2Bnodi.png>
>

-- 

--- 
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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to