You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/09/20 22:16:16 UTC
svn commit: r999098 [5/8] - in /subversion/branches/performance: ./
subversion/bindings/javahl/native/
subversion/bindings/javahl/src/org/apache/subversion/javahl/
subversion/bindings/javahl/src/org/tigris/subversion/javahl/
subversion/bindings/javahl/...
Modified: subversion/branches/performance/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_wc/wc-queries.sql?rev=999098&r1=999097&r2=999098&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/performance/subversion/libsvn_wc/wc-queries.sql Mon Sep 20 20:16:13 2010
@@ -33,6 +33,13 @@ select repos_id, repos_relpath, presence
from base_node
where wc_id = ?1 and local_relpath = ?2;
+-- STMT_SELECT_BASE_NODE_1
+select repos_id, repos_path, presence, kind, revision, checksum,
+ translated_size, changed_revision, changed_date, changed_author, depth,
+ symlink_target, last_mod_time, properties
+from nodes
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_SELECT_BASE_NODE_WITH_LOCK
select base_node.repos_id, base_node.repos_relpath, presence, kind,
revnum, checksum, translated_size, changed_rev, changed_date,
@@ -43,6 +50,16 @@ left outer join lock on base_node.repos_
and base_node.repos_relpath = lock.repos_relpath
where wc_id = ?1 and local_relpath = ?2;
+-- STMT_SELECT_BASE_NODE_WITH_LOCK_1
+select nodes.repos_id, nodes.repos_path, presence, kind, revision,
+ checksum, translated_size, changed_revision, changed_date, changed_author,
+ depth, symlink_target, last_mod_time, properties, lock_token, lock_owner,
+ lock_comment, lock_date
+from nodes
+left outer join lock on nodes.repos_id = lock.repos_id
+ and nodes.repos_path = lock.repos_relpath
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_SELECT_WORKING_NODE
select presence, kind, checksum, translated_size,
changed_rev, changed_date, changed_author, depth, symlink_target,
@@ -51,6 +68,15 @@ select presence, kind, checksum, transla
from working_node
where wc_id = ?1 and local_relpath = ?2;
+-- STMT_SELECT_WORKING_NODE_1
+select presence, kind, checksum, translated_size,
+ changed_revision, changed_date, changed_author, depth, symlink_target,
+ repos_id, repos_path, revision,
+ moved_here, moved_to, last_mod_time, properties
+from nodes
+where wc_id = ?1 and local_relpath = ?2 and op_depth > 0 order by op_depth desc
+limit 1;
+
-- STMT_SELECT_ACTUAL_NODE
select prop_reject, changelist, conflict_old, conflict_new,
conflict_working, tree_conflict_data, properties
@@ -86,15 +112,6 @@ insert or replace into nodes (
values (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14,
?15, ?16, ?17, ?18, ?19);
--- STMT_INSERT_NODE_DATA
-insert or replace into node_data (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind,
- changed_revision, changed_date, changed_author, depth, checksum,
- symlink_target, original_repos_id, original_repos_path,
- original_revision, properties)
-values (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12,
- ?13, ?14, ?15, ?16);
-
-- STMT_INSERT_BASE_NODE_INCOMPLETE
insert or ignore into base_node (
wc_id, local_relpath, parent_relpath, presence, kind, revnum)
@@ -111,11 +128,6 @@ INSERT OR IGNORE INTO WORKING_NODE (
wc_id, local_relpath, parent_relpath, presence, kind)
VALUES (?1, ?2, ?3, 'incomplete', 'unknown');
--- STMT_INSERT_NODE_DATA_INCOMPLETE
-INSERT OR IGNORE INTO NODE_DATA (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind)
-VALUES (?1, ?2, ?3, ?4, 'incomplete', 'unknown');
-
-- STMT_COUNT_BASE_NODE_CHILDREN
SELECT COUNT(*) FROM BASE_NODE
WHERE wc_id = ?1 AND parent_relpath = ?2;
@@ -144,10 +156,19 @@ where wc_id = ?1 and local_relpath = ?2;
select properties from base_node
where wc_id = ?1 and local_relpath = ?2;
+-- STMT_SELECT_BASE_PROPS_1
+select properties from nodes
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_SELECT_WORKING_PROPS
SELECT properties, presence FROM WORKING_NODE
WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_SELECT_WORKING_PROPS_1
+SELECT properties, presence FROM NODES
+WHERE wc_id = ?1 AND local_relpath = ?2
+AND op_depth > 0 ORDER BY op_depth DESC LIMIT 1;
+
-- STMT_SELECT_ACTUAL_PROPS
select properties from actual_node
where wc_id = ?1 and local_relpath = ?2;
@@ -156,20 +177,22 @@ where wc_id = ?1 and local_relpath = ?2;
update base_node set properties = ?3
where wc_id = ?1 and local_relpath = ?2;
--- STMT_UPDATE_NODE_DATA_BASE_PROPS
-update node_data set properties = ?3
+-- STMT_UPDATE_NODE_BASE_PROPS
+update nodes set properties = ?3
where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_UPDATE_WORKING_PROPS
update working_node set properties = ?3
where wc_id = ?1 and local_relpath = ?2;
--- STMT_UPDATE_NODE_DATA_WORKING_PROPS
-update node_data set properties = ?3
+-- STMT_UPDATE_NODE_WORKING_PROPS
+update nodes set properties = ?3
where wc_id = ?1 and local_relpath = ?2
and op_depth in
- (select max(op_depth) from node_data
- where wc_id = ?1 and local_relpath = ?2);
+ (select op_depth from nodes
+ where wc_id = ?1 and local_relpath = ?2
+ order by op_depth desc
+ limit 1);
-- STMT_UPDATE_ACTUAL_PROPS
update actual_node set properties = ?3
@@ -193,6 +216,10 @@ values (?1);
update base_node set dav_cache = ?3
where wc_id = ?1 and local_relpath = ?2;
+-- STMT_UPDATE_BASE_NODE_DAV_CACHE
+update nodes set dav_cache = ?3
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_SELECT_BASE_DAV_CACHE
select dav_cache from base_node
where wc_id = ?1 and local_relpath = ?2;
@@ -204,10 +231,6 @@ left outer join base_node on base_node.w
and base_node.local_relpath = working_node.local_relpath
where working_node.wc_id = ?1 and working_node.local_relpath = ?2;
--- STMT_SELECT_PARENT_STUB_INFO
-select presence = 'not-present', revnum from base_node
-where wc_id = ?1 and local_relpath = ?2;
-
-- STMT_DELETE_LOCK
delete from lock
where repos_id = ?1 and repos_relpath = ?2;
@@ -218,6 +241,12 @@ where dav_cache is not null and wc_id =
(local_relpath = ?2 or
local_relpath like ?3 escape '#');
+-- STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE
+update nodes set dav_cache = null
+where dav_cache is not null and wc_id = ?1 and op_depth = 0 and
+ (local_relpath = ?2 or
+ local_relpath like ?3 escape '#');
+
-- STMT_UPDATE_BASE_RECURSIVE_REPO
update base_node set repos_id = ?4
where repos_id is not null and wc_id = ?1 and
@@ -230,11 +259,11 @@ where copyfrom_repos_id is not null and
(local_relpath = ?2 or
local_relpath like ?3 escape '#');
--- STMT_UPDATE_NODE_DATA_RECURSIVE_ORIGINAL_REPO
-update node_data set original_repos_id = ?5
-where wc_id = ?1 and original_repos_id = ?4 and
- (local_relpath = ?2 or
- local_relpath like ?3 escape '#');
+-- STMT_RECURSIVE_UPDATE_NODE_REPO
+update NODES set repos_id = ?5, dav_cache = null
+where wc_id = ?1 and repos_id = ?4 and
+ (local_relpath = ?2
+ or local_relpath like ?3 escape '#');
-- STMT_UPDATE_LOCK_REPOS_ID
update lock set repos_id = ?4
@@ -246,10 +275,22 @@ where repos_id = ?1 and
UPDATE BASE_NODE SET translated_size = ?3, last_mod_time = ?4
WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_UPDATE_BASE_NODE_FILEINFO
+update nodes set translated_size = ?3, last_mod_time = ?4
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_UPDATE_WORKING_FILEINFO
UPDATE WORKING_NODE SET translated_size = ?3, last_mod_time = ?4
WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_UPDATE_WORKING_NODE_FILEINFO
+update nodes set translated_size = ?3, last_mod_time = ?4
+where wc_id = ?1 and local_relpath = ?2
+ and op_depth = (select op_depth from nodes
+ where wc_id = ?1 and local_relpath = ?2
+ order by op_depth desc
+ limit 1);
+
-- STMT_UPDATE_ACTUAL_TREE_CONFLICTS
update actual_node set tree_conflict_data = ?3
where wc_id = ?1 and local_relpath = ?2;
@@ -299,25 +340,21 @@ VALUES (?1, ?2, ?3, ?4);
delete from base_node
where wc_id = ?1 and local_relpath = ?2;
-/* ### Basically, this query can't exist:
- we can't be deleting BASE nodes while they still have
- associated WORKING nodes;
- at minimum, the op_depth restriction should be removed */
--- STMT_DELETE_NODE_DATA_BASE
-delete from node_data
+-- STMT_DELETE_BASE_NODE_1
+delete from nodes
where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_DELETE_WORKING_NODE
delete from working_node
where wc_id = ?1 and local_relpath = ?2;
--- STMT_DELETE_NODE_DATA_WORKING
-delete from node_data
+-- STMT_DELETE_WORKING_NODES
+delete from nodes
where wc_id = ?1 and local_relpath = ?2 and op_depth > 0;
--- STMT_DELETE_NODE_DATA_LAYERS
-delete from node_data
-where wc_id = ?1 and local_relpath = ?2 and op_depth >= ?3;
+-- STMT_DELETE_NODES
+delete from nodes
+where wc_id = ?1 and local_relpath = ?2;
-- STMT_DELETE_ACTUAL_NODE
delete from actual_node
@@ -328,45 +365,47 @@ UPDATE BASE_NODE SET depth = ?3
WHERE wc_id = ?1 AND local_relpath = ?2;
-- STMT_UPDATE_NODE_BASE_DEPTH
-UPDATE NODE_DATA SET depth = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
+update NODES set depth = ?3
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_UPDATE_WORKING_DEPTH
UPDATE WORKING_NODE SET depth = ?3
WHERE wc_id = ?1 AND local_relpath = ?2;
-- STMT_UPDATE_NODE_WORKING_DEPTH
-UPDATE NODE_DATA SET depth = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2 AND
- op_depth IN (SELECT MAX(op_depth) FROM NODE_DATA
- WHERE wc_id = ?1 AND local_relpath = ?2);
+update NODES set depth = ?3
+where wc_id = ?1 and local_relpath = ?2 and
+ op_depth in (select op_depth from NODES
+ where wc_id = ?1 and local_relpath = ?2
+ order by op_depth desc
+ limit 1);
-- STMT_UPDATE_BASE_EXCLUDED
UPDATE BASE_NODE SET presence = 'excluded', depth = NULL
WHERE wc_id = ?1 AND local_relpath = ?2;
-- STMT_UPDATE_NODE_BASE_EXCLUDED
-UPDATE NODE_DATA SET presence = 'excluded', depth = NULL
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
+update NODES set presence = 'excluded', depth = NULL
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_UPDATE_WORKING_EXCLUDED
UPDATE WORKING_NODE SET presence = 'excluded', depth = NULL
WHERE wc_id = ?1 AND local_relpath = ?2;
-- STMT_UPDATE_NODE_WORKING_EXCLUDED
-UPDATE NODE_DATA SET presence = 'excluded', depth = NULL
-WHERE wc_id = ?1 AND local_relpath = ?2 AND
- op_depth IN (SELECT op_depth FROM NODE_DATA
- WHERE wc_id = ?1 AND local_relpath = ?2
- ORDER BY op_depth DECSC
- LIMIT 1);
+update nodes SET presence = 'excluded', depth = NULL
+where wc_id = ?1 and local_relpath = ?2 and
+ op_depth IN (select op_depth from NODES
+ where wc_id = ?1 and local_relpath = ?2
+ order by op_depth DECSC
+ limit 1);
-- STMT_UPDATE_BASE_PRESENCE
update base_node set presence= ?3
where wc_id = ?1 and local_relpath = ?2;
-- STMT_UPDATE_NODE_BASE_PRESENCE
-update node_data set presence = ?3
+update nodes set presence = ?3
where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_UPDATE_BASE_PRESENCE_KIND
@@ -374,7 +413,7 @@ update base_node set presence = ?3, kind
where wc_id = ?1 and local_relpath = ?2;
-- STMT_UPDATE_NODE_BASE_PRESENCE_KIND
-update node_data set presence = ?3, kind = ?4
+update nodes set presence = ?3, kind = ?4
where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_UPDATE_WORKING_PRESENCE
@@ -382,9 +421,9 @@ update working_node set presence = ?3
where wc_id = ?1 and local_relpath =?2;
-- STMT_UPDATE_NODE_WORKING_PRESENCE
-update node_data set presence = ?3
+update nodes set presence = ?3
where wc_id = ?1 and local_relpath = ?2
- and op_depth in (select op_depth from node_data
+ and op_depth in (select op_depth from nodes
where wc_id = ?1 and local_relpath = ?2
order by op_depth desc
limit 1);
@@ -393,10 +432,18 @@ where wc_id = ?1 and local_relpath = ?2
update base_node set presence = ?3, revnum = ?4
where wc_id = ?1 and local_relpath = ?2;
+-- STMT_UPDATE_BASE_NODE_PRESENCE_AND_REVNUM
+update nodes set presence = ?3, revision = ?4
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_UPDATE_BASE_PRESENCE_REVNUM_AND_REPOS_RELPATH
update base_node set presence = ?3, revnum = ?4, repos_relpath = ?5
where wc_id = ?1 and local_relpath = ?2;
+-- STMT_UPDATE_BASE_NODE_PRESENCE_REVNUM_AND_REPOS_PATH
+update nodes set presence = ?3, revision = ?4, repos_path = ?5
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_LOOK_FOR_WORK
SELECT id FROM WORK_QUEUE LIMIT 1;
@@ -493,23 +540,19 @@ WHERE wc_id = ?1 AND local_dir_relpath L
/* translated_size and last_mod_time are not mentioned here because they will
be tweaked after the working-file is installed.
### what to do about file_external? */
-/* ### NODE_DATA the fields 'presence', 'kind', 'properties', 'changed_rev',
- 'changed_date', 'changed_author', 'depth', 'symlink_target' - but not:
- 'repos_id', 'repos_relpath', 'dav_cache' - will move to the NODE_DATA
- table, meaning we can't use this query anymore; we need 2, wrapped in a
- transaction. */
INSERT OR REPLACE INTO BASE_NODE (
wc_id, local_relpath, parent_relpath, presence, kind, revnum, changed_rev,
changed_author, properties, repos_id, repos_relpath, checksum, changed_date,
depth, symlink_target, dav_cache)
VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16);
--- STMT_APPLY_CHANGES_TO_BASE_NODE_DATA
-INSERT OR REPLACE INTO NODE_DATA (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind,
- changed_revision, changed_author, properties, checksum,
- changed_date, depth, symlink_target)
-VALUES (?1, ?2, 0, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12);
+-- STMT_APPLY_CHANGES_TO_BASE_NODE
+insert or replace into NODES (
+ wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
+ revision, presence, depth, kind, changed_revision, changed_date,
+ changed_author, checksum, properties, dav_cache, symlink_target )
+values (?1, ?2, 0,
+ ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16);
-- STMT_INSERT_WORKING_NODE_FROM_BASE_NODE
INSERT INTO WORKING_NODE (
@@ -521,24 +564,16 @@ SELECT wc_id, local_relpath, parent_relp
symlink_target, last_mod_time FROM BASE_NODE
WHERE wc_id = ?1 AND local_relpath = ?2;
--- STMT_INSERT_WORKING_NODE_DATA_FROM_BASE_NODE_1
-/* ### NODE_DATA This statement and the statement below (_2) need to
- be executed in a single transaction */
-INSERT INTO NODE_DATA (
+-- STMT_INSERT_WORKING_NODE_FROM_BASE
+INSERT INTO NODES (
wc_id, local_relpath, op_depth, parent_relpath, presence, kind, checksum,
- changed_revision, changed_date, changed_author, depth, symlink_target )
-SELECT wc_id, local_relpath, ?4 as op_depth, parent_relpath, ?3 AS presence,
- kind, checksum, changed_revision, changed_date,
- changed_author, depth, symlink_target
-FROM NODE_DATA
-WHERE wc_id = ?1 AND local_relpath = ?2 and op_depth = 0;
-
--- STMT_INSERT_WORKING_NODE_DATA_FROM_BASE_NODE_2
-INSERT INTO WORKING_NODE (
- wc_id, local_relpath, parent_relpath, translated_size, last_mod_time )
-SELECT wc_id, local_relpath, parent_relpath, translated_size, last_mod_time
-FROM BASE_NODE
-WHERE wc_id = ?1 AND local_relpath = ?2;
+ changed_revision, changed_date, changed_author, depth, symlink_target,
+ translated_size, last_mod_time, properties)
+SELECT wc_id, local_relpath, ?3 as op_depth, parent_relpath, ?4 as presence,
+ kind, checksum, changed_revision, changed_date, changed_author, depth,
+ symlink_target, translated_size, last_mod_time, properties
+FROM NODES
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
-- STMT_INSERT_WORKING_NODE_NORMAL_FROM_BASE_NODE
INSERT INTO WORKING_NODE (
@@ -552,30 +587,18 @@ SELECT wc_id, local_relpath, parent_relp
repos_relpath, revnum FROM BASE_NODE
WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_INSERT_WORKING_NODE_DATA_NORMAL_FROM_BASE_NODE_1
-INSERT INTO NODE_DATA (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind, checksum,
- changed_revision, changed_date, changed_author, depth, symlink_target,
- properties, original_repos_id, original_repos_path, original_revision )
-SELECT n.wc_id, n.local_relpath, ?3 as op_depth, n.parent_relpath, 'normal',
- n.kind,
- n.checksum, n.changed_revision, n.changed_date, n.changed_author, n.depth,
- n.symlink_target, n.properties, b.repos_id as original_repos_id,
- b.repos_relpath as original_repos_relpath, b.revnum as original_revision
-FROM BASE_NODE as b INNER JOIN NODE_DATA as n
- ON b.wc_id = n.wc_id
- AND b.local_relpath = n.local_relpath
- AND n.op_depth = 0
-WHERE n.wc_id = ?1 AND n.local_relpath = ?2;
-
-
--- STMT_INSERT_WORKING_NODE_DATA_NORMAL_FROM_BASE_NODE_2
-INSERT INTO WORKING_NODE (
- wc_id, local_relpath, parent_relpath, translated_size, last_mod_time )
-SELECT wc_id, local_relpath, parent_relpath, translated_size, last_mod_time
-FROM BASE_NODE
-WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_INSERT_WORKING_NODE_NORMAL_FROM_BASE
+insert into NODES (
+ wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
+ revision, presence, depth, kind, changed_revision, changed_date,
+ changed_author, checksum, properties, translated_size, last_mod_time,
+ symlink_target )
+select wc_id, local_relpath, ?3 as op_depth, parent_relpath, repos_id,
+ repos_path, revision, 'normal', depth, kind, changed_revision,
+ changed_date, changed_author, checksum, properties, translated_size,
+ last_mod_time, symlink_target
+from NODES
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_INSERT_WORKING_NODE_NOT_PRESENT_FROM_BASE_NODE
@@ -588,26 +611,15 @@ SELECT wc_id, local_relpath, parent_relp
repos_relpath, revnum FROM BASE_NODE
WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE_1
-INSERT INTO NODE_DATA (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind,
- changed_revision, changed_date, changed_author, original_repos_id,
- original_repos_path, original_revision )
-SELECT wc_id, local_relpath, ?3 as op_depth, parent_relpath, 'not-present',
- kind, changed_rev, changed_date, changed_author, repos_id,
- repos_relpath, revnum
-FROM BASE_NODE as b INNER JOIN NODE_DATA as n
- ON b.local_relpath = n.local_relpath
- AND b.wc_id = n.wc_id
- AND n.op_depth = 0
-WHERE n.wc_id = ?1 AND n.local_relpath = ?2;
-
-
--- STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE_2
-INSERT INTO WORKING_NODE (
- wc_id, local_relpath, parent_relpath)
-VALUES (?1, ?2, ?3);
+-- STMT_INSERT_WORKING_NODE_NOT_PRESENT_FROM_BASE
+insert into NODES (
+ wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
+ revision, presence, kind, changed_revision, changed_date, changed_author )
+select wc_id, local_relpath, ?3 as op_depth, parent_relpath, repos_id,
+ repos_path, revision, 'not-present', kind, changed_revision,
+ changed_date, changed_author
+from NODES
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- ### the statement below should be setting copyfrom_revision!
@@ -622,6 +634,17 @@ UPDATE WORKING_NODE SET
copyfrom_revnum = null
WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_UPDATE_COPYFROM_TO_INHERIT_1
+UPDATE NODES SET
+ repos_id = null,
+ repos_path = null,
+ revision = null
+WHERE wc_id = ?1 AND local_relpath = ?2
+ AND op_depth IN (SELECT op_depth FROM nodes
+ WHERE wc_id = ?1 AND local_relpath = ?2
+ ORDER BY op_depth DESC
+ LIMIT 1);
+
-- STMT_DETERMINE_TREE_FOR_RECORDING
SELECT 0 FROM BASE_NODE WHERE wc_id = ?1 AND local_relpath = ?2
UNION
@@ -642,30 +665,18 @@ SELECT wc_id, ?3 AS local_relpath, ?4 AS
?7 AS copyfrom_repos_path, ?8 AS copyfrom_revnum FROM BASE_NODE
WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_INSERT_WORKING_NODE_DATA_COPY_FROM_BASE_1
-INSERT OR REPLACE INTO NODE_DATA (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind, checksum,
- changed_revision, changed_date, changed_author, depth, symlink_target,
- properties, original_repos_id, original_repos_path, original_revision )
-SELECT n.wc_id, ?3 AS local_relpath, ?4 AS op_depth, ?5 AS parent_relpath,
- ?6 AS presence, n.kind, n.checksum, n.changed_revision, n.changed_date,
- n.changed_author, n.depth, n.symlink_target, n.properties,
- ?7 AS original_repos_id, ?8 AS original_repos_path,
- ?9 AS original_revision
-FROM BASE_NODE AS b INNER JOIN NODE_DATA AS n
- ON b.wc_id = n.wc_id
- AND b.local_relpath = n.local_relpath
- AND n.op_depth = 0
-WHERE n.wc_id = ?1 AND n.local_relpath = ?2;
-
--- STMT_INSERT_WORKING_NODE_DATA_COPY_FROM_BASE_2
-INSERT OR REPLACE INTO WORKING_NODE (
- wc_id, local_relpath, parent_relpath, translated_size, last_mod_time )
-SELECT wc_id, local_relpath, parent_relpath, translated_size, last_mod_time
-FROM BASE_NODE
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
+-- STMT_INSERT_WORKING_NODE_COPY_FROM_BASE_1
+insert or replace into NODES (
+ wc_id, local_relpath, op_depth, parent_relpath, repos_id,
+ repos_path, revision, presence, depth, kind, changed_revision,
+ changed_date, changed_author, checksum, properties, translated_size,
+ last_mod_time, symlink_target )
+select wc_id, ?3 as local_relpath, ?4 as op_depth, ?5 as parent_relpath,
+ ?6 as repos_id, ?7 as repos_path, ?8 as revision, ?9 as presence, depth,
+ kind, changed_revision, changed_date, changed_author, checksum, properties,
+ translated_size, last_mod_time, symlink_target
+from NODES
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING
INSERT OR REPLACE INTO WORKING_NODE (
@@ -679,33 +690,20 @@ SELECT wc_id, ?3 AS local_relpath, ?4 AS
?7 AS copyfrom_repos_path, ?8 AS copyfrom_revnum FROM WORKING_NODE
WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_INSERT_WORKING_NODE_DATA_COPY_FROM_WORKING_1
-INSERT OR REPLACE INTO NODE_DATA (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind, checksum,
- changed_revision, changed_date, changed_author, depth, symlink_target,
- properties, original_repos_id, original_repos_path, original_revision )
-SELECT n.wc_id, ?3 AS local_relpath, ?4 AS op_depth, ?5 AS parent_relpath,
- ?6 AS presence, n.kind, n.checksum, n.changed_revision, n.changed_date,
- n.changed_author, n.depth, n.symlink_target, n.properties,
- ?7 AS original_repos_id, ?8 AS original_repos_path,
- ?9 as original_revision
-FROM WORKING_NODE AS w INNER JOIN NODE_DATA AS n
- ON w.wc_id = n.wc_id
- AND w.local_relpath = n.local_relpath
-WHERE w.wc_id = ?1 AND w.local_relpath = ?2
-ORDER BY n.op_depth
-LIMIT 1;
-
--- STMT_INSERT_WORKING_NODE_DATA_COPY_FROM_WORKING_2
-/* ### there's probably no need to set translated_size and last_mod_time,
- they are probably set again later (after re-expanding the base) */
-INSERT OR REPLACE INTO WORKING_NODE (
- wc_id, local_relpath, parent_relpath, translated_size, last_mod_time )
-SELECT wc_id, ?3 as local_relpath, ?4 as parent_relpath,
- translated_size, last_mod_time
-FROM WORKING_NODE
-WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING_1
+insert or replace into NODES (
+ wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
+ revision, presence, depth, kind, changed_revision, changed_date,
+ changed_author, checksum, properties, translated_size, last_mod_time,
+ symlink_target )
+select wc_id, ?3 as local_relpath, ?4 as op_depth, ?5 as parent_relpath,
+ ?6 as repos_id, ?7 as repos_path, ?8 as revision, ?9 as presence, depth,
+ kind, changed_revision, changed_date, changed_author, checksum, properties,
+ translated_size, last_mod_time, symlink_target
+from NODES
+where wc_id = ?1 and local_relpath = ?2
+order by op_depth desc
+limit 1;
-- STMT_INSERT_ACTUAL_NODE_FROM_ACTUAL_NODE
INSERT OR REPLACE INTO ACTUAL_NODE (
@@ -726,10 +724,18 @@ SELECT 0 FROM WORKING_NODE WHERE wc_id =
UPDATE BASE_NODE SET revnum=?3
WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_UPDATE_BASE_REVISION_1
+update nodes set revision = ?3
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_UPDATE_BASE_REPOS
UPDATE BASE_NODE SET repos_id = ?3, repos_relpath = ?4
WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_UPDATE_BASE_REPOS_1
+update nodes set repos_id = ?3, repos_path = ?4
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
/* ------------------------------------------------------------------------- */
/* these are used in entries.c */
@@ -743,18 +749,15 @@ insert or replace into base_node (
values (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14,
?15, ?16);
--- STMT_INSERT_BASE_NODE_DATA_FOR_ENTRY_1
-insert or replace into base_node (
- wc_id, local_relpath, parent_relpath, repos_id, repos_relpath, revnum,
- translated_size, last_mod_time )
-values (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8);
-
--- STMT_INSERT_BASE_NODE_DATA_FOR_ENTRY_2
+-- STMT_INSERT_BASE_NODE_FOR_ENTRY_1
/* The BASE tree has a fixed op_depth '0' */
-insert or replace into node_data (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind, checksum,
- changed_revision, changed_date, changed_author, depth, properties )
-values (?1, ?2, 0, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11);
+insert or replace into nodes (
+ wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
+ revision, presence, kind, checksum,
+ changed_revision, changed_date, changed_author, depth, properties,
+ translated_size, last_mod_time )
+values (?1, ?2, 0, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13,
+ ?14, ?15, ?16 );
-- STMT_INSERT_WORKING_NODE
insert or replace into working_node (
Modified: subversion/branches/performance/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_wc/wc.h?rev=999098&r1=999097&r2=999098&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/performance/subversion/libsvn_wc/wc.h Mon Sep 20 20:16:13 2010
@@ -44,19 +44,13 @@ extern "C" {
#define SVN_WC__PROP_REJ_EXT ".prej"
-#define SVN_WC__BASE_EXT ".svn-base" /* for text and prop bases */
-#define SVN_WC__WORK_EXT ".svn-work" /* for working propfiles */
-#define SVN_WC__REVERT_EXT ".svn-revert" /* for reverting a replaced
- file */
-
-
/* We can handle this format or anything lower, and we (should) error
* on anything higher.
*
* There is no format version 0; we started with 1.
*
- * The change from 1 to 2 was the introduction of SVN_WC__WORK_EXT.
+ * The change from 1 to 2 was the introduction of the ".svn-work" extension.
* For example, ".svn/props/foo" became ".svn/props/foo.svn-work".
*
* The change from 2 to 3 was the introduction of the entry attribute
@@ -134,14 +128,6 @@ extern "C" {
#define SVN_WC__VERSION 19
-/* ### SVN_WC__SINGLE_DB and SINGLE_DB were both used in development
- ### and will both disappear before the final 1.7 release. */
-#if SVN_WC__VERSION >= 19
-#define SVN_WC__SINGLE_DB
-#define SINGLE_DB
-#endif
-
-
/* Formats <= this have no concept of "revert text-base/props". */
#define SVN_WC__NO_REVERT_FILES 4