Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

92415: Merged 5.0.N (5.0.1) to HEAD-BUG-FIX (5.1/Cloud)
      92316: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.1)
         92211: MNT-12862: Merged DEV to V4.2-BUG-FIX (4.2.5)
            92199: MNT-12862: Performance and memory issues cleaning up deleted nodes
               - Split statements for cleaning up deleted nodes out into a separate sql map file and create the MySQL-specific version


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94873 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 11:49:56 +00:00
parent be16d56838
commit 45d980c2de
5 changed files with 75 additions and 33 deletions

View File

@@ -204,6 +204,7 @@ Inbound settings from iBatis
<mapper resource="alfresco/ibatis/#resource.dialect#/node-common-SqlMap.xml"/>
<mapper resource="alfresco/ibatis/#resource.dialect#/node-select-children-SqlMap.xml"/>
<mapper resource="alfresco/ibatis/#resource.dialect#/node-update-SqlMap.xml"/>
<mapper resource="alfresco/ibatis/#resource.dialect#/node-delete-SqlMap.xml"/>
<mapper resource="alfresco/ibatis/#resource.dialect#/node-insert-SqlMap.xml"/>
<mapper resource="alfresco/ibatis/#resource.dialect#/patch-common-SqlMap.xml"/>
<mapper resource="alfresco/ibatis/#resource.dialect#/permissions-common-SqlMap.xml"/>

View File

@@ -511,37 +511,6 @@
<if test="typeQNameId != null">and type_qname_id = #{typeQNameId}</if>
</delete>
<delete id="delete_NodesByTxnCommitTime" parameterType="TransactionQuery">
<![CDATA[
delete from alf_node
where
type_qname_id = #{typeQNameId} and
transaction_id <=
(
select max(txn.id) from alf_transaction txn
where
txn.commit_time_ms < #{maxCommitTime}
)
]]>
</delete>
<delete id="delete_NodePropsByTxnCommitTime" parameterType="TransactionQuery">
<![CDATA[
delete from alf_node_properties
where exists
(
select 1
from
alf_node node
join alf_transaction txn on (txn.id = node.transaction_id)
where
node.type_qname_id = #{typeQNameId} and
alf_node_properties.node_id = node.id and
txn.commit_time_ms < #{maxCommitTime}
)
]]>
</delete>
<delete id="delete_NodeProperties" parameterType="NodeProperty">
delete from alf_node_properties
where

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="alfresco.node.delete">
<delete id="delete_NodesByTxnCommitTime" parameterType="TransactionQuery">
<![CDATA[
delete from alf_node
where
type_qname_id = #{typeQNameId} and
transaction_id <=
(
select max(txn.id) from alf_transaction txn
where
txn.commit_time_ms < #{maxCommitTime}
)
]]>
</delete>
<delete id="delete_NodePropsByTxnCommitTime" parameterType="TransactionQuery">
<![CDATA[
delete from alf_node_properties
where exists
(
select 1
from
alf_node node
join alf_transaction txn on (txn.id = node.transaction_id)
where
node.type_qname_id = #{typeQNameId} and
alf_node_properties.node_id = node.id and
txn.commit_time_ms < #{maxCommitTime}
)
]]>
</delete>
</mapper>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="alfresco.node.delete">
<delete id="delete_NodesByTxnCommitTime" parameterType="TransactionQuery">
<![CDATA[
delete node from alf_node node
inner join alf_transaction txn on (txn.id = node.transaction_id)
where
node.type_qname_id = #{typeQNameId} and
txn.commit_time_ms < #{maxCommitTime}
]]>
</delete>
<delete id="delete_NodePropsByTxnCommitTime" parameterType="TransactionQuery">
<![CDATA[
delete from alf_node_properties
where
node_id IN
(
select node.id
from
alf_node node
join alf_transaction txn on (txn.id = node.transaction_id)
where
node.type_qname_id = #{typeQNameId} and
txn.commit_time_ms < #{maxCommitTime}
)
]]>
</delete>
</mapper>

View File

@@ -89,8 +89,8 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
private static final String UPDATE_NODE = "alfresco.node.update_Node";
private static final String UPDATE_NODE_BULK_TOUCH = "alfresco.node.update_NodeBulkTouch";
private static final String DELETE_NODE_BY_ID = "alfresco.node.delete_NodeById";
private static final String DELETE_NODES_BY_TXN_COMMIT_TIME = "alfresco.node.delete_NodesByTxnCommitTime";
private static final String DELETE_NODE_PROPS_BY_TXN_COMMIT_TIME = "alfresco.node.delete_NodePropsByTxnCommitTime";
private static final String DELETE_NODES_BY_TXN_COMMIT_TIME = "alfresco.node.delete.delete_NodesByTxnCommitTime";
private static final String DELETE_NODE_PROPS_BY_TXN_COMMIT_TIME = "alfresco.node.delete.delete_NodePropsByTxnCommitTime";
private static final String SELECT_NODE_BY_ID = "alfresco.node.select_NodeById";
private static final String SELECT_NODE_BY_NODEREF = "alfresco.node.select_NodeByNodeRef";
private static final String SELECT_NODES_BY_UUIDS = "alfresco.node.select_NodesByUuids";