Yes that seems to be it. The time seems to increase as more records are
inserted. When its <500 records I'm seeing like 10 per second. But when
There are like 3500 records having been inserted I'm seeing as much as 3
seconds per query.
Do I need to do something to force the index to "re-index" the records
being added?
-Seamus
On Tuesday, July 22, 2014 6:19:47 PM UTC-4, Lvc@ wrote:
>
> Hi Seamus,
> So where most the time is spent? In the following line of code?
>
> for (Vertex v : graph.query().has("id", dbuser.id).limit(1).vertices())
>
> Lvc@
>
>
>
> On 22 July 2014 22:10, Seamus Minogue <[email protected] <javascript:>>
> wrote:
>
>> The scenario is that I am trying to pull a bunch of data out of an
>> existing database and storing it in an orientDb which is running embedded
>> in my application. I am running into some performance problems,
>> specifically when I add queries to verify that the data I am about to
>> insert into orient is unique the performance is killing me.
>>
>> I am only dealing with 7000 rows of data in my database as a test case,
>> The below snippet of code is showing what I am doing. Assume that of the
>> 7000 rows there are 1500 unique user ID's. When I just do inserts and dont
>> worry about duplicates This runs in 7 seconds. When I add the query its
>> taking ~20mins.
>>
>> I was going through the performance tuning suggestions trying to find an
>> answer... I figure I must be doing something wrong.
>>
>>
>> OServer server = OServerMain.create();
>>
>> server.startup(...);
>>
>> server.activate();
>> graph = new OrientGraphNoTx("plocal:/tmp/test", "admin", "admin");
>>
>> graph.getRawGraph().declareIntent(new OIntentMassiveInsert());
>> graph.getRawGraph().setValidationEnabled(false);
>>
>> graph.getRawGraph().setRetainRecords(false);
>>
>> graph.createKeyIndex("id", Vertex.class, new Parameter<String, String>(
>> "type", "UNIQUE"), new Parameter<String, String>("class", "User"));
>>
>> //Read user from existing store and create object (mundane details)
>> User dbuser = fetchUserFromOutside();
>>
>> Vertex user = null;
>>
>> for (Vertex v : graph.query().has("id", dbuser.id).limit(1).vertices())
>>
>> {
>> user = v;
>> }
>>
>> if(user == null){
>>
>> user =graph.addVertex("class:User","id", dbuser.id);
>>
>> }
>>
>>
>>
>> --
>>
>> ---
>> 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] <javascript:>.
>> 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.