Excessive number of total requests to process `graph.getVertices(key, value)`
See original GitHub issueOrientDB Version, operating system, or hardware.
- v2.2.7 (orientdb-graphdb Java API client and server)
Operating System
- Linux
Expected behavior and actual behavior
Expected: binary protocol operation fulfilled in fewer than 10 requests Actual: operation fulfilled in over 380 requests
Steps to reproduce the problem
I have a database with 480 vertices stored, and I’m trying to do a look up of one of those vertices that has a unique property value. I perform this lookup like so:
OrientBaseGraph graph = factory.getTx;
Iterable<Vertex> result = graph.getVertices(key, value);
where key
is an attribute of a subset of the vertices and value
is a unique string of just one vertex in the database. If I execute list connections
in the OrientDB console I see that this one operation made 4 requests to the database with a single connection:
orientdb {server=remote:localhost/}> list connections
+----+----+----------------+------+-------------------+--------+----+-----------+--------+
|# |ID |REMOTE_ADDRESS |PROTOC|LAST_OPERATION_ON |DATABASE|USER|COMMAND |TOT_REQS|
+----+----+----------------+------+-------------------+--------+----+-----------+--------+
|0 |32 |/127.0.0.1:56834|binary|2016-08-28 15:42:10|- |- |Server Info|2 |
|1 |31 |/127.0.0.1:56833|binary|2016-08-28 15:42:01|- |- |Listening |4 |
+----+----+----------------+------+-------------------+--------+----+-----------+--------+
Seems reasonable, though I would think this could be done in just 1 request. Also, what I get is just a collection of results, I still have to iterate over the result set to get the elements inside (there’s guaranteed to be one and only one element in this collection based on the key-value set on those vertices). So I do that with:
Vertex v = result.iterator().next();
When I check my connections again, I get taken a bit by surprise:
orientdb {server=remote:localhost/}> list connections
+----+----+----------------+------+-------------------+--------+----+-----------+--------+
|# |ID |REMOTE_ADDRESS |PROTOC|LAST_OPERATION_ON |DATABASE|USER|COMMAND |TOT_REQS|
+----+----+----------------+------+-------------------+--------+----+-----------+--------+
|0 |32 |/127.0.0.1:56834|binary|2016-08-28 15:45:53|- |- |Server Info|3 |
|1 |31 |/127.0.0.1:56833|binary|2016-08-28 15:45:51|- |- |Listening |383 |
+----+----+----------------+------+-------------------+--------+----+-----------+--------+
It took 383 requests to pull just one element out of an OrientGraphQueryIterable
!! This seems very bizarre/inefficient. What does the orientdb-graphdb
client do when it’s contacting the server? I can do a simple select * from V where key = value
from the browser and get results in just one request. I would expect to be able to perform the same operation using the Graph API client in no more than 10 requests. Can someone from the OrientDB team explain what’s going on?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Hi All,
I fixed the issue for the case of empty transaction, so your case should not do anymore all this request.
It will be released in 2.2.9
No reply since a while, closing this.