You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/04/21 12:53:27 UTC

svn commit: r1095652 - /subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

Author: rhuijben
Date: Thu Apr 21 10:53:27 2011
New Revision: 1095652

URL: http://svn.apache.org/viewvc?rev=1095652&view=rev
Log:
* subversion/libsvn_wc/wc-metadata.sql
  (STMT_CREATE_NODES_TRIGGERS/nodes_update_checksum_trigger):
     Don't update the pristine table if the checksum didn't change.
     We had a noticable slowdown on recording new timestamps and sizes in
     an existing node, but this case is also reached from the post update
     revision bump.
  (STMT_UPGRADE_TO_29): Apply this change to existing working copies with
     the next format bump.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

Modified: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-metadata.sql?rev=1095652&r1=1095651&r2=1095652&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-metadata.sql Thu Apr 21 10:53:27 2011
@@ -521,7 +521,8 @@ END;
 
 CREATE TRIGGER nodes_update_checksum_trigger
 AFTER UPDATE OF checksum ON nodes
-/* WHEN NEW.checksum IS NOT NULL OR OLD.checksum IS NOT NULL */
+WHEN NEW.checksum IS NOT OLD.checksum
+  /* AND (NEW.checksum IS NOT NULL OR OLD.checksum IS NOT NULL) */
 BEGIN
   UPDATE pristine SET refcount = refcount + 1
   WHERE checksum = NEW.checksum;
@@ -661,6 +662,25 @@ WHERE EXISTS(SELECT 1 FROM pristine WHER
 
 PRAGMA user_version = 28;
 
+/* ------------------------------------------------------------------------- */
+
+/* Format 29 introduces ... */
+
+-- STMT_UPGRADE_TO_29
+
+DROP TRIGGER IF EXISTS nodes_update_checksum_trigger;
+
+CREATE TRIGGER nodes_update_checksum_trigger
+AFTER UPDATE OF checksum ON nodes
+WHEN NEW.checksum IS NOT OLD.checksum
+  /* AND (NEW.checksum IS NOT NULL OR OLD.checksum IS NOT NULL) */
+BEGIN
+  UPDATE pristine SET refcount = refcount + 1
+  WHERE checksum = NEW.checksum;
+  UPDATE pristine SET refcount = refcount - 1
+  WHERE checksum = OLD.checksum;
+END;
+
 
 /* ------------------------------------------------------------------------- */