diff --git a/cronjobs/updatemodifiednodes.php b/cronjobs/updatemodifiednodes.php
index e69de29..af058bf 100644
--- a/cronjobs/updatemodifiednodes.php
+++ b/cronjobs/updatemodifiednodes.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Update modified nodes cronjob
+ *
+ * @copyright Copyright (C) 1999-2010 eZ Systems AS. All rights reserved.
+ * @license http://ez.no/licenses/gnu_gpl GNU GPLv2
+ */
+
+if ( !$isQuiet )
+    $cli->output( 'Updating modified nodes' );
+
+$contentIni = eZINI::instance( 'content.ini' );
+$pathArray = $contentIni->variable( 'NodeSettings', 'SkipUpdateModifiedNodes' );
+
+if ( count( $pathArray ) > 0 )
+{
+    $db = eZDB::instance();
+    $db->query( 'UPDATE ezcontentobject_tree SET modified_subnode=' . time() .
+                ' WHERE ' . $db->generateSQLINStatement( $pathArray, 'node_id', false, true, 'int' ) );
+}
+
+?>
diff --git a/kernel/classes/ezcontentobjecttreenode.php b/kernel/classes/ezcontentobjecttreenode.php
index 1e74f97..1a323aa 100644
--- a/kernel/classes/ezcontentobjecttreenode.php
+++ b/kernel/classes/ezcontentobjecttreenode.php
@@ -5544,6 +5544,14 @@ class eZContentObjectTreeNode extends eZPersistentObject
     {
         $pathArray = explode( '/', trim( $this->attribute( 'path_string' ), '/' ) );
 
+        // Filter out root nodes
+        $contentIni = eZINI::instance( 'content.ini' );
+        $skipNodes = $contentIni->variable( 'NodeSettings', 'SkipUpdateModifiedNodes' );
+        if ( count( $skipNodes ) > 0 )
+        {
+            $pathArray = array_diff( $pathArray, $skipNodes );
+        }
+
         if ( count( $pathArray ) > 0 )
         {
             $db = eZDB::instance();
diff --git a/settings/content.ini b/settings/content.ini
index dd2ff5a..03cf23b 100644
--- a/settings/content.ini
+++ b/settings/content.ini
@@ -244,6 +244,25 @@ SetupRootNode=48
 # The node ID for the design tree
 DesignRootNode=58
 
+# Node IDs that will not be updated when publishing a node.
+# Normally all parent nodes are updated, up to the top level node 1.
+# This is a performance tuning setting that avoids lock wait timeouts on publishing.
+# If you use it, you must also use the cronjob: updatemodifiednodes.php
+# which will update all nodes set here.
+SkipUpdateModifiedNodes[]
+# Top level root node
+#SkipUpdateModifiedNodes[]=1
+# Content root node
+#SkipUpdateModifiedNodes[]=2
+# Users root node
+#SkipUpdateModifiedNodes[]=5
+# Media root node
+#SkipUpdateModifiedNodes[]=43
+# Setup root node
+#SkipUpdateModifiedNodes[]=48
+# Design root node
+#SkipUpdateModifiedNodes[]=58
+
 [ClassSettings]
 # Number of seconds to wait before removing class edit lock.
 DraftTimeout=7200
diff --git a/settings/cronjob.ini b/settings/cronjob.ini
index d1f567e..c8730d7 100644
--- a/settings/cronjob.ini
+++ b/settings/cronjob.ini
@@ -32,6 +32,7 @@ Scripts[]=linkcheck.php
 [CronjobPart-frequent]
 Scripts[]=notification.php
 Scripts[]=workflow.php
+Scripts[]=updatemodifiednodes.php
 
 [linkCheckSettings]
 # Specify full path of all site URL
