Author: rhuijben
Date: Sat May 26 22:31:53 2012
New Revision: 1342984

URL: http://svn.apache.org/viewvc?rev=1342984&view=rev
Log:
Avoid a full NODES table scan on every directory during 'svn upgrade', by
using the nodes_current view instead of a distinct.

Sqlite assumed that it could just walk the primary key (wc_id, local_relpath,)
to avoid using a temporary table for the DISTINCT. But for our usage that is
a very bad decision.

[This patch doesn't include the wc-queries-test.c change to allow backport to
 1.7.x]

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_ALL_FILES): Remove distinct and use nodes_current.

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

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1342984&r1=1342983&r2=1342984&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Sat May 26 22:31:53 
2012
@@ -1074,7 +1074,7 @@ WHERE tree_conflict_data IS NOT NULL
 UPDATE actual_node SET tree_conflict_data = NULL
 
 -- STMT_SELECT_ALL_FILES
-SELECT DISTINCT local_relpath FROM nodes
+SELECT local_relpath FROM nodes_current
 WHERE wc_id = ?1 AND parent_relpath = ?2 AND kind = 'file'
 
 -- STMT_UPDATE_NODE_PROPS


Reply via email to