Skip to content
Snippets Groups Projects
Commit 3a284c99 authored by Bruno Nocera Zanette's avatar Bruno Nocera Zanette
Browse files

Fix bug: Wrong COUNT query for OrientDB

Query was taking too long to execute.
parent b3f05b21
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ module OrientDb
##
# Count the number of edges existent
def get_in_edges_count(edge_class, id)
result = connection.query "SELECT COUNT(@rid) FROM #{edge_class} WHERE in = #{id}"
result = connection.query "SELECT IN('#{edge_class}').size() AS COUNT FROM Object WHERE @rid = #{id} LIMIT 1"
result.first["COUNT"].to_i
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment