Query Performance Issue

67 views
Skip to first unread message

shrikant pachauri

unread,
Nov 3, 2017, 4:00:07 AM11/3/17
to OrientDB

Greeting 

I am trying to insert say 10k vertices in graph DB. I am using a script file in javascript where I am using Orient DBs native query language. Now after creating a class from the vertices when i ran the query for the first time it takes me about 2.51s. Now if I ran the same query again it takes me about 0.92s to insert the 10k records. 

Now my question is this is there any sort of caching or some other mechanism which makes my execution of the second query faster than before. I have a perspective that May be it stored the compiled query of the first time and it does not need to compile the query next time in case it encounter the same query.

Any help would be appreciated

Luigi Dell'Aquila

unread,
Nov 3, 2017, 4:38:15 AM11/3/17
to orient-...@googlegroups.com
Hi Shrikant,

There are at least two factors that can impact performance here:

- OrientDB does some caching of SQL statements, so the first time you execute a query it has to be parsed from scratch, while the second time you will have the AST in cache
- there is a layer, called diskCache, that keeps recently used data in memory, so that you don't have to access disk to query it, probably this is the part that impacts your case the most

Thanks

Luigi


--

---
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

shrikant pachauri

unread,
Nov 4, 2017, 1:57:50 AM11/4/17
to OrientDB
thanks well thats what I thought.

one more thing while using the DB.command() to execute query can we externally set when to commit data into database like gremlin. In gremlin we can specify after insertion of how many records the database should commit. May be that can help me in getting better performance


To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.

Luigi Dell'Aquila

unread,
Nov 6, 2017, 3:07:18 AM11/6/17
to orient-...@googlegroups.com
No, unfortunately there is no such setting for now...

Thanks

Luigi


To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.

shrikant pachauri

unread,
Nov 7, 2017, 3:25:06 AM11/7/17
to OrientDB
Thanks Luigi

But my argument is gremlin should also somehow use the native query interface of the Orient DB. So what is the query or the command that gremlin internally calls for this purpose. One more thing is there any other way apart from using the gremlin in stack to control the database commit. I dont' understand how db.command() internally works and handle when to commit.

Regards
Shrikant
Reply all
Reply to author
Forward
0 new messages