You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
Which version of Sharding-Jdbc do you using?
sharingJdbc1.5.0
Expected behavior
Actual behavior
select语句中,当groupBy和orderBy的字段一样时,也会出现内存归并的情况,拉取全部数据进行merge。类似下面的SQL:
SELECT
co.id orderId,
co.order_no orderNo,
co.payer_type payerType,
co.id AS GROUP_BY_DERIVED_0 (这个是SQL改写之后,追加的别名,和select定义的冲突,导致alias不一致)
FROM
t1 co
LEFT JOIN t2 odt ON co.id = odt.order_id
WHERE
co.create_time BETWEEN '2018-01-01'
AND '2018-01-15'
GROUP BY
co.id DESC
ORDER BY
co.id DESC
完整实例SQL:
SELECT
co.id orderId,
co.order_no orderNo,
co.combo_name comboName,
co.combo_code comboCode,
co.buyer_id buyerId,
co.buyer_domain_id buyerDomainId,
co.buyer_name buyerName,
co.buyer_mobile buyerMobile,
co.buyer_real_name buyerRealName,
co.creator_id creatorId,
co.creator_name creatorName,
co.creator_work_no creatorWorkNo,
co.creator_real_name creatorRealName,
co.amount amount,
co.actual_amount actualAmount,
co.statusstatus,
co.create_time createTime,
co.last_update_time updateTime,
co.creator_org_id orgId,
co.creator_org_name orgName,
co.pay_type payType,
co.payer_type payerType
FROM
combo_order co LEFT JOIN order_detail odt ON co.id = odt.order_id
WHERE
AND co.create_time between #{conditions.createTimeBegin} and #{conditions.createTimeEnd}
GROUP BY
co.id DESC
ORDER BY
co.id DESC LIMIT #{start},#{ps}
Steps to reproduce the behavior
Please provide the reproduce example codes (such as github link) if possible.
The text was updated successfully, but these errors were encountered:
terrymanu
changed the title
Select时同时存在GroupBy和OrderBy且item一样时存在内存归并的情况
When GROUP BY and ORDER BY aliases are inconsistent, stream merging should be used
Aug 8, 2018
Please answer these questions before submitting your issue. Thanks!
Which version of Sharding-Jdbc do you using?
sharingJdbc1.5.0
Expected behavior
Actual behavior
select语句中,当groupBy和orderBy的字段一样时,也会出现内存归并的情况,拉取全部数据进行merge。类似下面的SQL:
SELECT
co.id orderId,
co.order_no orderNo,
co.payer_type payerType,
co.id AS GROUP_BY_DERIVED_0 (这个是SQL改写之后,追加的别名,和select定义的冲突,导致alias不一致)
FROM
t1 co
LEFT JOIN t2 odt ON co.id = odt.order_id
WHERE
co.create_time BETWEEN '2018-01-01'
AND '2018-01-15'
GROUP BY
co.id DESC
ORDER BY
co.id DESC
完整实例SQL:
SELECT
co.id orderId,
co.order_no orderNo,
co.combo_name comboName,
co.combo_code comboCode,
co.buyer_id buyerId,
co.buyer_domain_id buyerDomainId,
co.buyer_name buyerName,
co.buyer_mobile buyerMobile,
co.buyer_real_name buyerRealName,
co.creator_id creatorId,
co.creator_name creatorName,
co.creator_work_no creatorWorkNo,
co.creator_real_name creatorRealName,
co.amount amount,
co.actual_amount actualAmount,
co.
status
status
,co.create_time createTime,
co.last_update_time updateTime,
co.creator_org_id orgId,
co.creator_org_name orgName,
co.pay_type payType,
co.payer_type payerType
FROM
combo_order co LEFT JOIN order_detail odt ON co.id = odt.order_id
WHERE
AND co.create_time between #{conditions.createTimeBegin} and #{conditions.createTimeEnd}
GROUP BY
co.id DESC
ORDER BY
co.id DESC LIMIT #{start},#{ps}
Steps to reproduce the behavior
Please provide the reproduce example codes (such as github link) if possible.
The text was updated successfully, but these errors were encountered: