mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
84121: Merged V4.2-BUG-FIX (4.2.4) to HEAD-BUG-FIX (5.0/Cloud) 82508: Merged V4.1-BUG-FIX (4.1.10) to V4.2-BUG-FIX (4.2.4) 82319: Merged DEV to V4.1-BUG-FIX (4.1.10) 81073 : MNT-9532 : SQL performance issue - WHERE ... IS NULL statements - Initial commit to revert fixes for MNT-8527 (r48757) and MNT-9483 (r56137) as this fixes causes performance issue for Oracle. 81966 : MNT-9532 : SQL performance issue - WHERE ... IS NULL statements - Default value for feed_user_id and site_network is now @@NULL@@. - IS NULL clause was completly removed from activities queries. - Upgrade sql script was added to replace nulls for Oracle (empty strings for other dialect) with @@NULL@@. - Version schema was incremented by 1. 82278 : MNT-9532 : SQL performance issue - WHERE ... IS NULL statements - Fixed unit test failure. 83431: MNT-9532 : SQL performance issue - WHERE ... IS NULL statements - Fixed build failure 84115: MNT-9532/MNT-11871: with the revert of MNT-11871 patch, MNT-9532 should be using a lower schema number. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@84632 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
87 lines
4.7 KiB
XML
87 lines
4.7 KiB
XML
<?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">
|
|
|
|
<!--
|
|
Select statements that require proper size limiting on the DB side
|
|
Dialect: MySQL
|
|
-->
|
|
<mapper namespace="alfresco.activities.select">
|
|
|
|
<!-- -->
|
|
<!-- Selects -->
|
|
<!-- -->
|
|
|
|
<!-- user feed - all sites - everyone -->
|
|
<select id="select_activity_feed_for_feeduser" parameterType="ActivityFeedQuery" resultType="ActivityFeed" fetchSize="-2147483648">
|
|
select id as id, activity_type as activityType, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date as postDate
|
|
from alf_activity_feed
|
|
where feed_user_id = #{feedUserId}
|
|
<if test="minId != null"><![CDATA[ and id >= #{minId} ]]></if>
|
|
order by post_date desc
|
|
</select>
|
|
|
|
<!-- user feed - all sites - others (not me) -->
|
|
<select id="select_activity_feed_for_feeduser_others" parameterType="ActivityFeedQuery" resultType="ActivityFeed" fetchSize="-2147483648">
|
|
select id as id, activity_type as activityType, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date as postDate
|
|
from alf_activity_feed
|
|
where feed_user_id = #{feedUserId}
|
|
<![CDATA[ and post_user_id <> #{feedUserId} ]]>
|
|
<if test="minId != null"><![CDATA[ and id >= #{minId} ]]></if>
|
|
order by post_date desc
|
|
</select>
|
|
|
|
<!-- user feed - all sites - me only (not others) -->
|
|
<select id="select_activity_feed_for_feeduser_me" parameterType="ActivityFeedQuery" resultType="ActivityFeed" fetchSize="-2147483648">
|
|
select id as id, activity_type as activityType, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date as postDate
|
|
from alf_activity_feed
|
|
where feed_user_id = #{feedUserId}
|
|
and post_user_id = #{feedUserId}
|
|
<if test="minId != null"><![CDATA[ and id >= #{minId} ]]></if>
|
|
order by post_date desc
|
|
</select>
|
|
|
|
<!-- user feed - given site - everyone -->
|
|
<select id="select_activity_feed_for_feeduser_and_site" parameterType="ActivityFeedQuery" resultType="ActivityFeed" fetchSize="-2147483648">
|
|
select id as id, activity_type as activityType, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date as postDate
|
|
from alf_activity_feed
|
|
where feed_user_id = #{feedUserId}
|
|
and site_network = #{siteNetwork}
|
|
<if test="minId != null"><![CDATA[ and id >= #{minId} ]]></if>
|
|
order by post_date desc
|
|
</select>
|
|
|
|
<!-- user feed - given site - others (not me) -->
|
|
<select id="select_activity_feed_for_feeduser_others_and_site" parameterType="ActivityFeedQuery" resultType="ActivityFeed" fetchSize="-2147483648">
|
|
select id as id, activity_type as activityType, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date as postDate
|
|
from alf_activity_feed
|
|
where feed_user_id = #{feedUserId}
|
|
<![CDATA[ and post_user_id <> #{feedUserId} ]]>
|
|
and site_network = #{siteNetwork}
|
|
<if test="minId != null"><![CDATA[ and id >= #{minId} ]]></if>
|
|
order by post_date desc
|
|
</select>
|
|
|
|
<!-- user feed - given site - me only (not others) -->
|
|
<select id="select_activity_feed_for_feeduser_me_and_site" parameterType="ActivityFeedQuery" resultType="ActivityFeed" fetchSize="-2147483648">
|
|
select id as id, activity_type as activityType, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date as postDate
|
|
from alf_activity_feed
|
|
where feed_user_id = #{feedUserId}
|
|
and post_user_id = #{feedUserId}
|
|
and site_network = #{siteNetwork}
|
|
<if test="minId != null"><![CDATA[ and id >= #{minId} ]]></if>
|
|
order by post_date desc
|
|
</select>
|
|
|
|
<!-- site feed - given site -->
|
|
<select id="select_activity_feed_for_site" parameterType="ActivityFeedQuery" resultType="ActivityFeed" fetchSize="-2147483648">
|
|
<![CDATA[
|
|
select id as id, activity_type as activityType, activity_summary as activitySummary, post_user_id as postUserId, site_network as siteNetwork, post_date as postDate
|
|
from alf_activity_feed
|
|
where feed_user_id = #{nullValue}
|
|
and site_network = #{siteNetwork}
|
|
order by post_date desc
|
|
]]>
|
|
</select>
|
|
|
|
</mapper> |