Hi Rob,

Doing that from SQL is not efficient.

For this purposes you can use following methods from the API:
com.orientechnologies.orient.core.metadata.schema.OClass#count()
or
com.orientechnologies.orient.core.metadata.schema.OClass#count(boolean)

Best regards,
Artem Orobets

* Orient Technologiesthe Company behind OrientDB*


2014-05-30 0:14 GMT+03:00 Rob Gratz <[email protected]>:

> I have a parent/child hierarchy and am running a query to get counts per
> type of child.  The query works, but the performance is very slow.  I tried
> adding an index to the "@class" field, but got an error.  Is there a better
> way of getting this information aside from putting another field that has
> some class identifier in it?
>
> parent, child1, child2
>
> select count(*) from parent group by @class
>
> This comes back with the 2 correct counts (~ 4 seconds), but no
> identifier, so I modified it as follows:
>
> select @class, count(*) from parent group by @class
>
> Again, this came back with the counts and the classnames but was very slow
> (~12 seconds)
>
> Anyone have any similar experience
>
> --
>
> ---
> 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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to