Increment of vertices version control doesn't work

66 views
Skip to first unread message

Kalatheeswaran TM

unread,
Jul 3, 2015, 1:53:12 PM7/3/15
to orient-...@googlegroups.com
Hi,
I am using the Graph model and when I try to use the following code to control the version increment it doesn't work,

OGlobalConfiguration.INDEX_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD.setValue(-1);

Does the DB size gets increased with increase in the versions during the creation of edges.

I have a DB of 1 milllion vertices in Table A which has 4 edges to four other tables. All the 4 tables don't have records greater than 100,000.
The total DB size is 1GB.

Any help will be greatly useful.

Thanks,
Kalatheeswaran


Luca Garulli

unread,
Jul 4, 2015, 4:30:47 AM7/4/15
to orient-...@googlegroups.com
Are you running in distributed mode? About this line of code:

OGlobalConfiguration.INDEX_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD.setValue(-1);

When did you execute it? It must be done before any usage of OrientDB.

Best Regards,

Luca Garulli
CEO at Orient Technologies LTD
the Company behind OrientDB

--

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

Kalatheeswaran Thiru Meganathan

unread,
Jul 4, 2015, 4:46:10 AM7/4/15
to orient-...@googlegroups.com

No I am not running in distributed mode. I ran that code before opening the dB. What do you mean by usage? I create the db alone from the studio

How about the size. Can it be reduced?  I am using light weight edges only

You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/m69v51yRq6U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

Kalatheeswaran TM

unread,
Jul 4, 2015, 9:05:14 AM7/4/15
to orient-...@googlegroups.com
Please provide any help. Its urgent

Kalatheeswaran

Luca Garulli

unread,
Jul 6, 2015, 10:35:37 AM7/6/15
to orient-...@googlegroups.com
Hi,
You should set RID_BAG_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD to -1. Where did you find the setting "INDEX_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD" ? 



Best Regards,

Founder & CEO

Kalatheeswaran TM

unread,
Jul 6, 2015, 10:41:21 AM7/6/15
to orient-...@googlegroups.com
Hi,
Thanks for the reply. I found it in the docs:



Regards,
Kalatheeswaran


Kalatheeswaran TM

unread,
Jul 6, 2015, 10:44:55 AM7/6/15
to orient-...@googlegroups.com
Hi,
In the page here:

http://orientdb.com/docs/last/SQL-Delete-Edge.html

Also can you provide a few tips for increasing the speed during insertion and edge creation.

I have tried those found in docs and am able to insert 100,000 vertices in 20 seconds.

Creation of one edge from these vertices takes around 60 seconds.

I am running in plocal mode
 
Kalatheeswaran


Luca Garulli

unread,
Jul 6, 2015, 10:57:49 AM7/6/15
to orient-...@googlegroups.com
Hi,
Just fixed the documentation, thanks. In order to speed up edge creation, could you share the code you used?

Best Regards,

Founder & CEO


Kalatheeswaran TM

unread,
Jul 6, 2015, 11:09:00 AM7/6/15
to orient-...@googlegroups.com
The following is the code I use:

public void createEdge(TLBTables fromTable, TLBTables toTable, String edgeName, String mappedColumnName, String mappingColumn) {

        OGlobalConfiguration.CACHE_LOCAL_ENABLED.setValue(false);

        OrientBaseGraph graph = new OrientGraphNoTx(orientDBLocation);
        try {

            for (Vertex fromClassV : graph.getVerticesOfClass(fromTable
                    .toString())) {
                StringBuffer sqlBuf = new StringBuffer("CREATE EDGE ");
                sqlBuf.append(edgeName);
                sqlBuf.append(" FROM ");
                sqlBuf.append(fromClassV.getId());
                sqlBuf.append(" TO (SELECT FROM ");
                sqlBuf.append(toTable.toString());
                sqlBuf.append(" WHERE ");
                sqlBuf.append(mappedColumnName);
                sqlBuf.append("=");
                sqlBuf.append(fromClassV.getProperty(mappingColumn));
                sqlBuf.append(")");

                graph.command(new OCommandSQL(sqlBuf.toString())).execute();

                log.info("Successfully Created Edge " + fromTable + "->"
                        + toTable + " with Id[" + fromClassV.getId() + "]");
            }
        } catch (Exception e) {
            graph.rollback();
        } finally {
            graph.shutdown();
          OGlobalConfiguration.CACHE_LOCAL_ENABLED.setValue(true);
        }
 }

I am not sure of the correct way to use OGlobalConfiguration.CACHE_LOCAL_ENABLED. I get the same speed results with and without it.

Also is there any API call to get the all the vertices of a class from a specified index instead of getting all the vertices like in graph.getVerticesOfClass()

Thanks for your help

Regards,
Kalatheeswaran

Andrey Lomakin

unread,
Jul 6, 2015, 11:11:53 AM7/6/15
to orient-...@googlegroups.com
Hi,
Please never set OGlobalConfiguration.CACHE_LOCAL_ENABLED to false, if  you do not want to experience data consistency problems.

--

Kalatheeswaran TM

unread,
Jul 6, 2015, 11:44:32 AM7/6/15
to orient-...@googlegroups.com
Is there any alternative to it? What else can be done for increasing the speed of creation of edges?



Kalatheeswaran TM

unread,
Jul 7, 2015, 7:59:27 AM7/7/15
to orient-...@googlegroups.com
Please provide some suggestions?



Reply all
Reply to author
Forward
0 new messages