Re: [orientdb] How to speed up ORDER BY

2016-05-04 Thread David López Pérez

Hi Luigi, 

(I am a co-worker of Hung, the original author of this post)

Thank you very much for your answer. Creating the following index really 
improved the performance of that query (without @rid in ORDER BY clause).

CREATE INDEX Task.PriorityDueTime ON Task (Priority, DueTime) NOTUNIQUE

We tried that solution in the past, but it doesn't work because we were 
doing *ORDER BY Priority DESD, DueTime ASC*, and with that mixed ordering 
direction this solution does not work.
We can also achieve our target with *ORDER BY Priority **DESD**, DueTime *
*DESC*, so your answer is valid for us.

Thank you very much again.
David.


El miércoles, 4 de mayo de 2016, 11:48:09 (UTC+2), Luigi Dell'Aquila 
escribió:
>
> Hi,
>
> The problem here is that the result set can be sorted using the index when 
> you define ORDER BY Priority DESC, but when you add other conditions like 
> ORDER BY Priority DESC, @rid ASC then the index becomes useless and the 
> result set has to be sorted in memory.
> For the second case (ORDER BY Priority DESC, DueTime DESC) you can define 
> a composite index on Priority and DueTime, this should speed up the query a 
> lot.
> When @rid is involved in general, indexes are not helpful, because the rid 
> cannot be indexed in current release 
>
> 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Re: orient db disconnect/timeout

2016-05-04 Thread Luca Son
Hi Mihai,

the reasons of the issues can be diffferent (e.g. network problems) but 
similar issues have been fixed in the latest OrientDB versions.

Could you try to update to the latest 2.1.16 ?

Thanks

-- 

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


Re: [orientdb] How to speed up ORDER BY

2016-05-04 Thread Luigi Dell'Aquila
Hi,

The problem here is that the result set can be sorted using the index when
you define ORDER BY Priority DESC, but when you add other conditions like
ORDER BY Priority DESC, @rid ASC then the index becomes useless and the
result set has to be sorted in memory.
For the second case (ORDER BY Priority DESC, DueTime DESC) you can define a
composite index on Priority and DueTime, this should speed up the query a
lot.
When @rid is involved in general, indexes are not helpful, because the rid
cannot be indexed in current release

Thanks

Luigi


2016-04-25 7:14 GMT+02:00 Hung Tran :

> Hi,
>
> I am using OrientDB 2.1.8 on Windows 2012 server platform. I have a table
> about 1.117.549 records, with indices as following.
>
> Here are some queries and its timing captured from OrientDB Studio.
>
> SELECT  FROM Task WHERE (((DueTime <= '2016-04-25 04:19:58') AND (Status =
> 0)) OR ((ProcessId = 1) AND (Status = 10))) AND (EntityInfo.State = 0) ORDER
> BY Priority DESC, DueTime DESC, @rid ASC limit 1
> => it took 80.978 sec.
>
> SELECT  FROM Task WHERE (((DueTime <= '2016-04-25 04:19:58') AND (Status =
> 0)) OR ((ProcessId = 1) AND (Status = 10))) AND (EntityInfo.State = 0)
> ORDER BY Priority DESC, DueTime DESC limit 1
> => it took 81.544 sec.
>
> SELECT  FROM Task WHERE (((DueTime <= '2016-04-25 04:19:58') AND (Status =
> 0)) OR ((ProcessId = 1) AND (Status = 10))) AND (EntityInfo.State = 0)
> ORDER BY Priority DESC, @rid ASC limit 1
> => it took 75.335 sec.
>
> SELECT  FROM Task WHERE (((DueTime <= '2016-04-25 04:19:58') AND (Status =
> 0)) OR ((ProcessId = 1) AND (Status = 10))) AND (EntityInfo.State = 0)
> ORDER BY Priority DESC limit 1
> => it took 0.266 sec.
>
> SELECT  FROM Task WHERE (((DueTime <= '2016-04-25 04:19:58') AND (Status =
> 0)) OR ((ProcessId = 1) AND (Status = 10))) AND (EntityInfo.State = 0)
> limit 1
> => it took 0.275 sec.
>
>
> As you see the result, the ORDER BY on DueTime or @rid cause a poor
> performance. What do I need to do to speed them up now, any help will be
> very appreciated!
>
> My Best,
> Hung Tran
>
> --
>
> ---
> 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+unsubscr...@googlegroups.com.
> 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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [orientdb] Database as a single file?

2016-05-04 Thread david
Thank you for the quick reply.

I am not sure whether or not its a show-stopper for me, but for a desktop 
app, a single file is a useful feature. For instance H2 have the facility 
to support a database in a zip through its jdbc connector 
(jdbc:h2:zip:!/).

cheers


>

-- 

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


[orientdb] Re: orient db disconnect/timeout

2016-05-04 Thread Andrea Pravato
The same situation happens if we use the database from the same server in 
which the database is running, with the difference that the first warning 
is about Channel closed instead of Stream closed:
WARNING [com.orientechnologies.orient.client.remote.OStorageRemote] 
(default task-4) Caught I/O errors from Not connected (local socket=?), 
trying to reconnect (error: java.io.IOException: *Channel* closed)


On Wednesday, May 4, 2016 at 11:12:25 AM UTC+2, Mihai Ocneanu wrote:
>
> Hello,
>
> I'm having a strange issue with orientdb getting disconnected: after a 
> longer period of inactivity ( ~3hours ? ), when we try to insert/register a 
> new user, the attempt hangs on commit.
>
> There is no error, but a warnings in the server log:
>
>> WARNING [com.orientechnologies.orient.client.remote.OStorageRemote] 
>> (default task-4) Caught I/O errors from Not connected (local socket=?), 
>> trying to reconnect (error: java.io.IOException: Stream closed)
>> WARNING [com.orientechnologies.orient.client.remote.OStorageRemote] 
>> (default task-4) Connection re-acquired transparently after 156ms and 1 
>> retries to server '127.0.0.1:2424/ImpYMaster2': no errors will be thrown 
>> at application level
>>
>
> The code is nothing out of the ordinary:
>
> newUser = txGraph.addVertex("class:V_User");
> //set some properties
> userConfToken = txGraph.addVertex("class:V_UConfirmationToken");
> //set some other properties
> txGraph.addEdge("class:E_UserConfirmationToken", newUser, userConfToken, 
> "E_UserConfirmationToken");
> //just created an edge
>
> //and just commit the whole thing
> txGraph.commit();
>
> //where OrientGraph txGraph = graphFactory.getTx() ...
>
>
>
>
> By 'hangs', I mean, on commit, there are no errors thrown, the data gets 
> persisted, but any lines of code after the commit never get executed. All 
> our  code is executed as the result of a POST call, so the end result is 
> that the call never completes.
>
> The client/ JAVA API version is 2.1.6, and the DB version is the same.
> The transaction is *not* started manually.
> The app is packaged as a war and deployed with Wildfly.
> If the application is redeployed / Wildfly is restarted, it will work OK 
> until it will time-out/disconnect again.
>
> It's difficult track down/debug as it seems to happen after a long period 
> of inactivity.
>
> Q: Is is something related to the odb version? Should we try mis-matched 
> client/db versions?
> Q: How/when does the timeout/disconnect occur? Why does it occur? 
> Q: Can we change the timeout interval?
> Q: Is there a way to manually check within the Java API that we're 
> disconnected and then manually reconnect?
>
> Thanks,
> Mihai
>

-- 

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


[orientdb] orient db disconnect/timeout

2016-05-04 Thread Mihai Ocneanu
Hello,

I'm having a strange issue with orientdb getting disconnected: after a 
longer period of inactivity ( ~3hours ? ), when we try to insert/register a 
new user, the attempt hangs on commit.

There is no error, but a warnings in the server log:

> WARNING [com.orientechnologies.orient.client.remote.OStorageRemote] 
> (default task-4) Caught I/O errors from Not connected (local socket=?), 
> trying to reconnect (error: java.io.IOException: Stream closed)
> WARNING [com.orientechnologies.orient.client.remote.OStorageRemote] 
> (default task-4) Connection re-acquired transparently after 156ms and 1 
> retries to server '127.0.0.1:2424/ImpYMaster2': no errors will be thrown at 
> application level
>

The code is nothing out of the ordinary:

newUser = txGraph.addVertex("class:V_User");
//set some properties
userConfToken = txGraph.addVertex("class:V_UConfirmationToken");
//set some other properties
txGraph.addEdge("class:E_UserConfirmationToken", newUser, userConfToken, 
"E_UserConfirmationToken");
//just created an edge

//and just commit the whole thing
txGraph.commit();

//where OrientGraph txGraph = graphFactory.getTx() ...




By 'hangs', I mean, on commit, there are no errors thrown, the data gets 
persisted, but any lines of code after the commit never get executed. All 
our  code is executed as the result of a POST call, so the end result is 
that the call never completes.

The client/ JAVA API version is 2.1.6, and the DB version is the same.
The transaction is *not* started manually.
The app is packaged as a war and deployed with Wildfly.
If the application is redeployed / Wildfly is restarted, it will work OK 
until it will time-out/disconnect again.

It's difficult track down/debug as it seems to happen after a long period 
of inactivity.

Q: Is is something related to the odb version? Should we try mis-matched 
client/db versions?
Q: How/when does the timeout/disconnect occur? Why does it occur? 
Q: Can we change the timeout interval?
Q: Is there a way to manually check within the Java API that we're 
disconnected and then manually reconnect?

Thanks,
Mihai

-- 

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


Re: [orientdb] Re: oetl problems loading csv data to a document database

2016-05-04 Thread Luc Evers
  Luca,

 Do you have a solution for this problem?
 The Etl programs are not working for document databases.


 


Op dinsdag 26 april 2016 10:48:58 UTC+2 schreef Luc Evers:
>
>   Alessandro,
>
>Thanks for the test!
> Seems a problem for document databases.
>
>Luc.
>
>
> On Tue, Apr 26, 2016 at 10:44 AM,  wrote:
>
>> Hi,
>> I did some tests and I had no problems with a remote connection and a 
>> graph database, 
>> but I got your exception when I used a remote connection with a document 
>> database.
>>
>> Best regards,
>> Alessandro
>>
>> -- 
>>
>> --- 
>> 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/JHjCL7grdRk/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> orient-database+unsubscr...@googlegroups.com.
>> 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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Re: Distributed mode with multicast enabled don't work.

2016-05-04 Thread Luc Evers
  + The machine can handle multicast.


Op zondag 20 maart 2016 10:19:09 UTC+1 schreef Luc Evers:
>
>   Info
>
>OrientDB version: 2.1.13
>
>Test:  3 servers on the same lan, running ubuntu (14.04). 
>  OrientDB (root password installed), we didn't touch any 
> configuration or database.
>
> 1) Start dserver.sh  on the three servers, they start as 
> separated servers!  No error reports. (multicast enabled="true")
> Result:  no distributed database, the three orientdb 
> servers are running as separated databases.
>
> 2)  Change hazelcast.html :   multicast enabled="false"   
>  and extend  tcp-ip enbled="true" (fill in the three server ip addresses)
>   Result:  everything works fine, we have now a 
> distributed database.
>
>
>Do we need an additional configuration change to start the database in 
> multicast mode?
>
>We are interested in the multicastmode because in this mode you can add 
> a server on the fly.
>In the other case (tcp-ip) you need to change the hazelcast.xml on all 
> the servers?  (+ reload server)
>
>
> 
>
>

-- 

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


Re: [orientdb] Re: Distributed mode with multicast enabled don't work.

2016-05-04 Thread Luc Evers
  No, multicast enabled="true"

Op zondag 24 april 2016 17:01:25 UTC+2 schreef l.garulli:
>
> Hi Luc,
> I guess in the non working cfg, the multicast is simply off.
>
> Best Regards,
>
> Luca Garulli
> Founder & CEO
> OrientDB 
>
>
> On 24 April 2016 at 11:24, Luc Evers  
> wrote:
>
>>Luca,
>>
>>  Can you try the same test but now with docker installed on the 
>> servers?
>>
>>
>>Luc.
>>
>> Op zondag 17 april 2016 16:48:33 UTC+2 schreef Luc Evers:
>>
>>> *  Rem*
>>>
>>>  Both servers A are working fine in cluster if I use fix Ip 
>>> addresses, like before.
>>>
>>>
>>>
>>> Op zondag 17 april 2016 16:34:52 UTC+2 schreef Luc Evers:

Luca,  More information:

  * New test with orient : 2.1.15*

   *Result same problem: * no cluster with my two servers.

  * servers A:*  ubuntu version 14.04 LTS + docker installed
   
   *Second test :  move to another server pair:*

   *serversB:* ubuntu version 12.04 LTS  no docker installed.

  * Result:  No problem with multicast enabled="true", the cluster is 
 working fine!*

  The difference between the two server pairs is the Ubuntu version and 
 docker is installed in servers A.
   If I shut down docker + docker0 link I got an error from OrientDB 
 that the network was down.
   I think OrientDB has problems with the network configuration if 
 docker is installed.

 Rem:
 /sbin/ifconfig ->  servers A -> em1  (= network interface)
   servers B -> eth0


  




 Op woensdag 23 maart 2016 13:58:17 UTC+1 schreef Luc Evers:
>
>   Luca,
>
> If I fill in the ip address in the hazelcast configuration then 
> the cluster starts successful.
> I was following the OrientDB course on Udemy which very good 
> described how to start the cluster via multicast.
> 
>
>Best Regard,
>
> Luc.
>
> Op woensdag 23 maart 2016 11:36:40 UTC+1 schreef l.garulli:
>>
>> Is it working if you configure manual IP addresses?
>>
>> Best Regards,
>>
>> Luca Garulli
>> Founder & CEO
>> OrientDB 
>>
>>
>> On 23 March 2016 at 10:47, Luc Evers  wrote:
>>
>>>
>>>
>>> Op zondag 20 maart 2016 12:13:43 UTC+1 schreef Luca Son:

 Hi Luc,

 I tried your case by using Oracle VM VirtualBox and the following 
 configurations:

- 3 nodes and "root" password for each node;
-  in hazelcast.xml;
- other configurations all default.

 When I start up the 3 nodes they work correctly as distributed, do 
 you have any other configuration in your environment ?

 About your second question, I found this 
 
  documentation about 
 hazelcast configuration to be TCP/IP cluster.

 Hope it helps

 Luca

>>>
>>>  
>>>   Strange, de cluster don't work on seperate servers! No config 
>>> changed, only download , install root password and then start cluster.
>>>  
>>>
>>> -- 
>>>
>>> --- 
>>> 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.
>>>
>>
>> -- 
>>
>> --- 
>> 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.
>>
>
>

-- 

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


Re: [orientdb] Database as a single file?

2016-05-04 Thread Luigi Dell'Aquila
Hi David,

In current release this is not supported, and structurally it's not easy to
do, so I'm afraid it will hardly enter in the roadmap (but things can
change of course...)

Thanks

Luigi


2016-05-04 1:15 GMT+02:00 :

> This might be a stupid question, but is it possible to store a plocal
> database as a single file, rather than a directory?
>
> I am considering using OrientDB as an embedded database in a java desktop
> application, so keeping the database as a single file would be a big plus.
>
> --
>
> ---
> 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+unsubscr...@googlegroups.com.
> 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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.