Share » Forums » General » upgrade to 3.5.1 : deleting takes 10...

upgrade to 3.5.1 : deleting takes 10 minutes?...

upgrade to 3.5.1 : deleting takes 10 minutes?...

Saturday 05 March 2005 8:34:55 pm - 4 replies

Modified on Saturday 05 March 2005 8:37:34 pm by Gioele Agostinelli

Author Message

Raymond Bosman

Wednesday 09 March 2005 4:52:37 am

Ten minutes is not normal indeed. Can you check whether the main_node_id field of the ezcontentobject_tree table has an index?

If not create one on the main_node_id, this will definitely save a lot of time.

Raymond

Gioele Agostinelli

Wednesday 09 March 2005 1:10:08 pm

Hi Raymond,

Thank you for your suggestion, I added an index on main_node_id and now deletion of an object takes less then a second. The index isn't part of the sql schema by default; I think it should be a good idea to add it by default in next version of ez.

I also have another suggestion, I don't know if it is 100% bullet-proof but here it is anyway....

If I understood correctly, the query that was taking for ever is in subtreeSoleNodeCount(). This function is called by removeSubtrees() in kernel/classes/ezcontentobjecttreenode.php. If the object you are trying to delete isn't a container there shouldn't be any subtree and therefore no need to call the function subtreeSoleNodeCount() since it should always return 0. So I replaced the call of subtreeSoleNodeCount() in removeSubtrees() by :

if ( !$class->attribute( 'is_container' ) )
{
$soleNodeCount =0;
}
else
{
$soleNodeCount = $node->subtreeSoleNodeCount();
}

Since the only objects that I delete are articles which are not container on my site, deletion time returned to normal.

The modification is a bit dirty since the verification should be done in subtreeSoleNodeCount() and not in removeSubtrees()... but I was in a hurry... I'm sure you get the idea... there is no need to run the query if the object is not a container.

If I'm correct maybe it would be a good idea to add this kind of verification in next version of ez also.

Thank you again for your suggestion and have nice day!

Gioele

Jan Borsodi

Friday 11 March 2005 1:45:25 am

The <i>is_container</i> flag is merely meant as a user-interface hint than a strict rule for objects. This means that it is quite possible for an object to have children (e.g comments).

The reason why we check for children for all objects is to give the user feedback on how many children are going to be deleted. If we add this check children may be accidently removed.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Ekkehard Dörre

Monday 29 August 2005 5:59:58 am

Same Problem with 3.5.3
MySQL 3.23.49-log debian 40 sec., creating index didn't help, same istallation on testserver xp with MySQL 4.0.20a in 3 sec

Deleting 1 Object. Any Ideas?

SOLVED, it is voodoo, tried it again after 10 minutes, now it works.

Thanks, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu