Author: rhuijben
Date: Mon Mar 21 22:38:48 2011
New Revision: 1084001

URL: http://svn.apache.org/viewvc?rev=1084001&view=rev
Log:
Simplify and correct a query to allow it to be executed as 5 normal subqueries
instead of a huge join. I think it needs a bit more optimization, but I hope
this improves commit performance a bit for now.

The SQLite query analyzer shows that the same subquery is performed more then
once, so this can really use some further work.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_WORKING_CHILDREN): Add MAX() to the subqueries that retrieve the
    parent node op_depth as a single result instead of as a join.

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=1084001&r1=1084000&r2=1084001&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Mon Mar 21 22:38:48 
2011
@@ -175,10 +175,10 @@ WHERE wc_id = ?1 AND parent_relpath = ?2
    working version of the directory. */
 SELECT local_relpath FROM nodes_current
 WHERE wc_id = ?1 AND parent_relpath = ?2
-  AND (op_depth > (SELECT op_depth FROM nodes_current
+  AND (op_depth >= (SELECT MAX(op_depth) FROM nodes_current
                    WHERE wc_id = ?1 AND local_relpath = ?2)
        OR
-       (op_depth = (SELECT op_depth FROM nodes_current
+       (op_depth = (SELECT MAX(op_depth) FROM nodes_current
                     WHERE wc_id = ?1 AND local_relpath = ?2)
         AND presence != 'base-deleted'))
 


Reply via email to