Update statement causes CPU hang at 100%

69 views
Skip to first unread message

Hung Tran

unread,
Dec 30, 2015, 11:59:43 AM12/30/15
to orient-...@googlegroups.com
Hi,

I am running on OrientDB v1.7.8, here is my Update SQL

UPDATE Statistics 
   
SET NumActiveContacts = $activeContacts.size(),
       
NumContacts = $totalContacts.size()
   LET $activeContacts
= (SELECT FROM Contact
                               
WHERE (Account=#20:0
                                 
AND OwnedBy.Statistics=$parent.$current
                                 
AND Status=0
                                 
AND OwnedBy.EntityInfo.State<>200)
                                 
AND EntityInfo.State=0),
       $totalContacts
= (SELECT FROM Contact
                               
WHERE (Account=#20:0
                                 
AND OwnedBy.Statistics=$parent.$current
                                 
AND OwnedBy.EntityInfo.State<>200)
                                 
AND EntityInfo.State=0)
 
WHERE @rid IN (SELECT Statistics FROM ContactList WHERE Account=#20:0 AND EntityInfo.State=0)

it's working with table less than 10k rows, and it keep running more than 24+ hours to update at 100% CPU for OrientDB-1_7 process when my Statistics table is about 200k rows. Remarks, the Update above will only need to update 10k rows, run in Studio, database server is no activity earlier.

Indices on Contact table


Indices on ContactList table

Any help will be really appreciated!

My Best,
Hung Tran

Andrey Lomakin

unread,
Jan 5, 2016, 2:20:31 AM1/5/16
to OrientDB
Hi.
Sorry but we do not support such old versions, any reason why you can not upgrade to newer version ?

On Wed, Dec 30, 2015 at 6:59 PM Hung Tran <tdhu...@gmail.com> wrote:
Hi,

I am running on OrientDB v1.7.8, here is my Update SQL

UPDATE Statistics 
   
SET NumActiveContacts = $activeContacts.size(),
       
NumContacts = $totalContacts.size()
   LET $activeContacts
= (SELECT FROM Contact
                               
WHERE (Account=#20:0
                                 
AND OwnedBy.Statistics=$parent.$current
                                 
AND Status=0
                                 
AND OwnedBy.EntityInfo.State<>200)
                                 
AND EntityInfo.State=0),
       $totalContacts
= (SELECT FROM Contact
                               
WHERE (Account=#20:0
                                 
AND OwnedBy.Statistics=$parent.$current
                                 
AND OwnedBy.EntityInfo.State<>200)
                                 
AND EntityInfo.State=0)
 
WHERE @rid IN (SELECT Statistics FROM ContactList WHERE Account=#20:0 AND EntityInfo.State=0)

it's working with table less than 10k rows, and it keep running more than 24+ hours to update at 100% CPU for OrientDB-1_7 process when my Statistics table is about 200k rows. Remarks, the Update above will only need to update 10k rows.

Indices on Contact table


Indices on ContactList table

Any help will be really 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-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Best regards,
Andrey Lomakin, R&D lead. 
OrientDB Ltd

twitter:@Andrey_Lomakin linkedin:https://ua.linkedin.com/in/andreylomakin
Reply all
Reply to author
Forward
0 new messages