[Cubicweb] Entity deletion is slow

Julien Cristau julien.cristau at logilab.fr
Tue Sep 9 09:38:17 CEST 2014

On Fri, Aug 29, 2014 at 10:37:31 +0200, Yann Cointepas wrote:

> Hi,
> I have a database with 309 862 entities of type ScoreValue (from medicalexp
> cube). As shown below, accessing these entities takes less than 3 seconds
> but deleting them takes more than 23 minutes. I did the same test after I
> removed as many hooks as possible (cube without dependencies, copied only
> the entities I need from other cubes, removed all "composite" in relations)
> but there is no difference. I would appreciate to understand why is it so
> slow. And if there is a solution to speed-ud entity deletion it would be
> great.
> I discovered this problem because I have several studies in my brainomics
> based instance and sometimes I need to remove completely one study to
> restart the script that populate the instance. I use a simple query 'DELETE
> Any X WHERE X belong_to S, S name "MEMENTO"' (belong_to is a relation I
> added to manage permissions). I focused on ScoreValue just to have a simple
> example but I would like to speed-up the deletion of the whole study.
You could try enabling hook debugging:
  from cubicweb.server import set_debug, DBG_HOOKS, DBG_OPS
  rql('DELETE ...')
and see if that gives you a clue about which hooks or operations are
getting in the way.

Julien Cristau          <julien.cristau at logilab.fr>
Logilab		        http://www.logilab.fr/
Informatique scientifique & gestion de connaissances

More information about the Cubicweb mailing list