You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2010/10/08 18:10:14 UTC
svn commit: r1005879 - in /subversion/trunk/subversion/libsvn_wc:
wc-queries.sql wc_db.c
Author: philip
Date: Fri Oct 8 16:10:13 2010
New Revision: 1005879
URL: http://svn.apache.org/viewvc?rev=1005879&view=rev
Log:
Use of one query rather than two to gather children, it's slightly faster.
* subversion/libsvn_wc/wc-queries.sql
(STMT_SELECT_WORKING_NODE_CHILDREN): Renamed to ...
(STMT_SELECT_NODE_CHILDREN): ...this, remove op_depth test and DISTINCT.
* subversion/libsvn_wc/wc_db.c
(gather_children): Use one SQL query.
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=1005879&r1=1005878&r2=1005879&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Fri Oct 8 16:10:13 2010
@@ -103,9 +103,9 @@ VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8,
SELECT local_relpath FROM nodes
WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = 0;
--- STMT_SELECT_WORKING_NODE_CHILDREN
-SELECT DISTINCT local_relpath FROM nodes
-WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth > 0;
+-- STMT_SELECT_NODE_CHILDREN
+SELECT local_relpath FROM nodes
+WHERE wc_id = ?1 AND parent_relpath = ?2;
-- STMT_SELECT_BASE_PROPS
SELECT properties FROM nodes
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1005879&r1=1005878&r2=1005879&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Oct 8 16:10:13 2010
@@ -907,12 +907,15 @@ gather_children(const apr_array_header_t
scratch_pool, scratch_pool));
VERIFY_USABLE_PDH(pdh);
- /* All of the names get allocated in RESULT_POOL. */
- SVN_ERR(add_children_to_hash(names_hash, STMT_SELECT_BASE_NODE_CHILDREN,
- pdh->wcroot->sdb, pdh->wcroot->wc_id,
- local_relpath, result_pool));
- if (! base_only)
- SVN_ERR(add_children_to_hash(names_hash, STMT_SELECT_WORKING_NODE_CHILDREN,
+ /* All of the names get allocated in RESULT_POOL. For !base_only it
+ appears to be faster to use the hash to remove duplicates than to
+ use DISTINCT in the SQL query. */
+ if (base_only)
+ SVN_ERR(add_children_to_hash(names_hash, STMT_SELECT_BASE_NODE_CHILDREN,
+ pdh->wcroot->sdb, pdh->wcroot->wc_id,
+ local_relpath, result_pool));
+ else
+ SVN_ERR(add_children_to_hash(names_hash, STMT_SELECT_NODE_CHILDREN,
pdh->wcroot->sdb, pdh->wcroot->wc_id,
local_relpath, result_pool));