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 2012/05/25 10:39:07 UTC

svn commit: r1342528 - in /subversion/trunk/subversion/libsvn_wc: wc-queries.sql wc_db.c

Author: rhuijben
Date: Fri May 25 08:39:07 2012
New Revision: 1342528

URL: http://svn.apache.org/viewvc?rev=1342528&view=rev
Log:
Slow down a query a tiny bit by making it use the targets list in a way
that it was designed for. This makes it use the proper index.

Removing this index that doesn't even provide the required ordering makes
the overall result of this (and other targets_list operations) faster.

So the overall result is a performance improvement.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_MARK_SKIPPED_CHANGELIST_DIRS): Properly select targets on wc_id
    and local_relpath instead of just on kind.
  (STMT_CREATE_TARGETS_LIST): Remove index on just kind.

* subversion/libsvn_wc/wc_db.c
  (set_changelist_txn): Pass wc_id and local_relpath.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc-queries.sql
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1342528&r1=1342527&r2=1342528&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Fri May 25 08:39:07 2012
@@ -393,7 +393,11 @@ UPDATE actual_node SET changelist = NULL
 -- STMT_MARK_SKIPPED_CHANGELIST_DIRS
 /* 7 corresponds to svn_wc_notify_skip */
 INSERT INTO changelist_list (wc_id, local_relpath, notify, changelist)
-SELECT wc_id, local_relpath, 7, ?1 FROM targets_list WHERE kind = 'dir'
+SELECT wc_id, local_relpath, 7, ?3
+FROM targets_list
+WHERE wc_id = ?1
+  AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
+  AND kind = 'dir'
 
 -- STMT_RESET_ACTUAL_WITH_CHANGELIST
 REPLACE INTO actual_node (
@@ -457,8 +461,6 @@ CREATE TEMPORARY TABLE targets_list (
   kind TEXT NOT NULL,
   PRIMARY KEY (wc_id, local_relpath)
   );
-CREATE INDEX targets_list_kind
-  ON targets_list (kind)
 /* need more indicies? */
 
 -- STMT_DROP_TARGETS_LIST

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1342528&r1=1342527&r2=1342528&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri May 25 08:39:07 2012
@@ -5100,7 +5100,8 @@ set_changelist_txn(void *baton,
       /* We have to notify that we skipped directories, so do that now. */
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                         STMT_MARK_SKIPPED_CHANGELIST_DIRS));
-      SVN_ERR(svn_sqlite__bind_text(stmt, 1, scb->new_changelist));
+      SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id, local_relpath,
+                                scb->new_changelist));
       SVN_ERR(svn_sqlite__step_done(stmt));
     }