HI,
It is the same, SELECT sum(outE().size()) FROM V

But looks nice :-)


On Wed, Mar 12, 2014 at 9:59 PM, Riccardo Tasso <riccardo.ta...@gmail.com>wrote:

> What about executing the following query:
>
> SELECT sum(out().size()) FROM V
>
> Can it be considered more efficient than iterating over the whole vertices
> set or is it the same?
>
> Riccardo
>
>
> 2014-03-12 15:37 GMT+01:00 Luca Garulli <l.garu...@gmail.com>:
>
> Hi,
>> OrientDB uses lazy loading technique, so as soon as you browse elements
>> OrientDB loads it. Obviously not all the loaded stuff remain in memory, but
>> is flushed away when other elements are loaded (like LRU).
>>
>> Lvc@
>>
>>
>>
>> On 12 March 2014 21:33, Sotiris Beis <sot.b...@gmail.com> wrote:
>>
>>>  I just realized what you was saying. Sorry. Your suggestion worked.
>>>
>>> One more quetion. I have 1M nodes and 3M edges. I wonder if when I
>>> iterate through all the nodes the whole graph is loaded in the memory,
>>> because it needs about 2G of ram to count all the edges.
>>>
>>> Sotiris
>>>
>>> On 03/12/2014 04:05 PM, Andrey Lomakin wrote:
>>>
>>> HI,
>>> But as I have written you use wrong method, you use 
>>> *OrientBaseGraph*.countEdges
>>> but should use *OrientVertex*.countEdges
>>>
>>>  You count edges for current vertex and sum them up, right ?
>>>
>>>
>>> On Wed, Mar 12, 2014 at 1:58 PM, Sotiris Beis <sot.b...@gmail.com>wrote:
>>>
>>>>  I have upgraded to rc2 but nothig actually changed.
>>>>
>>>> I initialize my graph instance this way
>>>> OrientGraph orientGraph = orientGraph = new
>>>> OrientGraph("plocal:"+dbPAth);
>>>>
>>>> and when i try to count the edges i simply do this
>>>> orientGraph.countEdges()
>>>>
>>>> The only function I still have is this OrientBaseGraph.countEdges
>>>>
>>>>
>>>> On 03/12/2014 01:31 PM, Andrey Lomakin wrote:
>>>>
>>>> You can find it
>>>> https://github.com/orientechnologies/orientdb/blob/develop/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientVertex.java#L322
>>>>
>>>>  Do you use 1.7-rc2 snapshot ?
>>>>
>>>>
>>>> On Wed, Mar 12, 2014 at 1:23 PM, Sotiris Beis <sot.b...@gmail.com>wrote:
>>>>
>>>>>  This function seems to be missing.
>>>>> I use orientdb-1.7-SNAPSHOT
>>>>>
>>>>> On 03/12/2014 01:16 PM, Andrey Lomakin wrote:
>>>>>
>>>>>  Oh hold on.
>>>>> But you use wrong method.
>>>>>
>>>>>  I suggested to use com.tinkerpop.blueprints.
>>>>> impls.orient.OrientVertex#countEdges but you use OrientBaseGraph.
>>>>> countEdges
>>>>>
>>>>>
>>>>> On Wed, Mar 12, 2014 at 1:15 PM, Andrey Lomakin <
>>>>> lomakin.and...@gmail.com> wrote:
>>>>>
>>>>>> That is stack trace form your application code.
>>>>>> Could you publish stack trace for exception cause too ?
>>>>>>
>>>>>>
>>>>>> On Wed, Mar 12, 2014 at 11:43 AM, Sotiris Beis <sot.b...@gmail.com>wrote:
>>>>>>
>>>>>>>  Exception in thread "main"
>>>>>>> java.lang.UnsupportedOperationException: Graph set to use Lightweight
>>>>>>> Edges, count against edges is not supported
>>>>>>>  at
>>>>>>> com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.countEdges(OrientBaseGraph.java:1038)
>>>>>>>  at
>>>>>>> eu.socialsensor.graphdatabases.OrientGraphDatabase.getGraphWeightSum(OrientGraphDatabase.java:272)
>>>>>>>  at
>>>>>>> eu.socialsensor.graphdatabases.OrientGraphDatabase.main(OrientGraphDatabase.java:40)
>>>>>>>
>>>>>>>
>>>>>>> Τη Τετάρτη, 12 Μαρτίου 2014 8:05:53 π.μ. UTC+2, ο χρήστης Andrey
>>>>>>> Lomakin έγραψε:
>>>>>>>>
>>>>>>>>  Could you send full stacktrace ?
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Mar 11, 2014 at 6:36 PM, Sotiris Beis <sot....@gmail.com>wrote:
>>>>>>>>
>>>>>>>>> Hi Andrey,
>>>>>>>>>
>>>>>>>>>  I get the following exception:
>>>>>>>>>
>>>>>>>>>   Exception in thread "main"
>>>>>>>>>> java.lang.UnsupportedOperationException: Graph set to use Lightweight
>>>>>>>>>> Edges, count against edges is not supported
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Τη Τρίτη, 11 Μαρτίου 2014 6:26:17 μ.μ. UTC+2, ο χρήστης Andrey
>>>>>>>>> Lomakin έγραψε:
>>>>>>>>>>
>>>>>>>>>>  Hi,
>>>>>>>>>> You can
>>>>>>>>>> use com.tinkerpop.blueprints.impls.orient.OrientVertex#countEdges 
>>>>>>>>>> method.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  On Tue, Mar 11, 2014 at 6:19 PM, Sotiris Beis <sot....@gmail.com
>>>>>>>>>> > wrote:
>>>>>>>>>>
>>>>>>>>>>>  I am implementing Louvain algorithm in order execute community
>>>>>>>>>>> detection in graph databases. Right now I word on the OrientGraph 
>>>>>>>>>>> case
>>>>>>>>>>> study. As far as know due to lightweight edges I can't count them 
>>>>>>>>>>> this way:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> int count = 0;
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> for(Edge edge : orientGraph.getEdges()) {
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>     count++;}
>>>>>>>>>>>
>>>>>>>>>>>  I found the following way to count them:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Set<Object> edges = new HashSet();
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> for(Vertex v : orientGraph.getVertices()) {
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>     for( Edge e : v.getEdges( Direction.BOTH ) )
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>       edges.add( e.getIdentity() );
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> }return edges.size();
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> My question is: Is this the best way to count the edges of an
>>>>>>>>>>> orient graph?
>>>>>>>>>>>   --
>>>>>>>>>>>
>>>>>>>>>>> ---
>>>>>>>>>>> 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-databa...@googlegroups.com.
>>>>>>>>>>>
>>>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  --
>>>>>>>>>> Best regards,
>>>>>>>>>> Andrey Lomakin.
>>>>>>>>>>
>>>>>>>>>> Orient Technologies
>>>>>>>>>> the Company behind OrientDB
>>>>>>>>>>
>>>>>>>>>>     --
>>>>>>>>>
>>>>>>>>> ---
>>>>>>>>> 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-databa...@googlegroups.com.
>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>  --
>>>>>>>> Best regards,
>>>>>>>> Andrey Lomakin.
>>>>>>>>
>>>>>>>> Orient Technologies
>>>>>>>> the Company behind OrientDB
>>>>>>>>
>>>>>>>>     --
>>>>>>>
>>>>>>> ---
>>>>>>> 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.
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>  --
>>>>>> Best regards,
>>>>>> Andrey Lomakin.
>>>>>>
>>>>>> Orient Technologies
>>>>>> the Company behind OrientDB
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>  --
>>>>> Best regards,
>>>>> Andrey Lomakin.
>>>>>
>>>>> Orient Technologies
>>>>> the Company behind OrientDB
>>>>>
>>>>>  --
>>>>>
>>>>> ---
>>>>>  You received this message because you are subscribed to a topic in
>>>>> the Google Groups "OrientDB" group.
>>>>> To unsubscribe from this topic, visit
>>>>> https://groups.google.com/d/topic/orient-database/Hd8F9QeS0l4/unsubscribe
>>>>> .
>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>> orient-database+unsubscr...@googlegroups.com.
>>>>>
>>>>> 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 orient-database+unsubscr...@googlegroups.com.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>>  --
>>>> Best regards,
>>>> Andrey Lomakin.
>>>>
>>>> Orient Technologies
>>>> the Company behind OrientDB
>>>>
>>>>  --
>>>>
>>>> ---
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "OrientDB" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/orient-database/Hd8F9QeS0l4/unsubscribe
>>>> .
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> orient-database+unsubscr...@googlegroups.com.
>>>> 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 orient-database+unsubscr...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>>  --
>>> Best regards,
>>> Andrey Lomakin.
>>>
>>> Orient Technologies
>>> the Company behind OrientDB
>>>
>>>  --
>>>
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "OrientDB" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/orient-database/Hd8F9QeS0l4/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> orient-database+unsubscr...@googlegroups.com.
>>> 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 orient-database+unsubscr...@googlegroups.com.
>>> 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 orient-database+unsubscr...@googlegroups.com.
>> 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 orient-database+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

-- 

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