Author: rhuijben
Date: Sun Apr 17 16:04:32 2011
New Revision: 1094164
URL: http://svn.apache.org/viewvc?rev=1094164&view=rev
Log:
Make a very heavy query simpler and (by removing the LIKE operator) operating
on an index.
* subversion/libsvn_wc/wc-queries.sql
(STMT_DELETE_SHADOWED_RECURSIVE): Simplify query. Given a valid DB, we should
only see base deleted at the op-depth we are processing right now.
* subversion/libsvn_wc/wc_db.c
(commit_node): Update caller.
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=1094164&r1=1094163&r2=1094164&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Sun Apr 17 16:04:32
2011
@@ -164,13 +164,11 @@ WHERE wc_id = ?1 AND parent_relpath = ?2
-- STMT_DELETE_SHADOWED_RECURSIVE
DELETE FROM nodes
-WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
- AND (op_depth < ?4
- OR (presence = 'base-deleted'
- AND op_depth = (SELECT MIN(op_depth) FROM nodes f
- WHERE f.wc_id = nodes.wc_id
- AND f.local_relpath = nodes.local_relpath
- AND f.op_depth >= ?4)))
+WHERE wc_id = ?1
+ AND (local_relpath = ?2
+ OR ((local_relpath > ?2 || '/') AND (local_relpath < ?2 || '0')))
+ AND (op_depth < ?3
+ OR (op_depth = ?3 AND presence = 'base-deleted'))
-- STMT_SELECT_NODE_CHILDREN
/* Return all paths that are children of the directory (?1, ?2) in any
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1094164&r1=1094163&r2=1094164&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Sun Apr 17 16:04:32 2011
@@ -6865,11 +6865,9 @@ commit_node(void *baton,
STMT_DELETE_SHADOWED_RECURSIVE));
SVN_ERR(svn_sqlite__bindf(delete_stmt,
- "issi",
+ "isi",
wcroot->wc_id,
local_relpath,
- construct_like_arg(local_relpath,
- scratch_pool),
op_depth));
SVN_ERR(svn_sqlite__step_done(delete_stmt));