重现步骤

[步骤]




[18:47:16]  -------------------------------------------------------------
CODE:O1847161
Error:16_8623_1_-2146232060
SQL:
select 
orderfee.BusinessTeamID GROUPID
,orderfee.BusinessTeamName GroupName
,orderfee.OperateFeeRMB
,orderfee.OperateFeeUSD,orderfee.SalesPriceFeeRMB
,orderfee.SalesPriceFeeUSD
,ISNULL(ordernum.OrderNum,0) OrderNum
,orderfee.FundMoneyRMB,orderfee.FundMoneyUSD
,orderfee.SalesRefundsV2RMB,orderfee.SalesRefundsV2USD
,cast(MONTH(orderfee.DateToday) AS varchar) + '/'+ cast(DAY(orderfee.DateToday) AS varchar) AS XAxis
,orderfee.DateToday 
from 
(
select 
CustomerID
    ,BusinessTeamID
    ,case when  BusinessTeamName='' then '未分组' else BusinessTeamName end  BusinessTeamName
    ,CONVERT(NVARCHAR(50),ShipDate,23) DateToday
,SUM(Profits) OperateFeeRMB,SUM(Profits/USD_ExchangeRMB) OperateFeeUSD
,SUM(SalesPrice+TransportPay+SalesRefunds+PromotionRebates+OtherCredits+ISNULL(Tax,0)+ISNULL(MarketplaceFacilitatorTax,0)) SalesPriceFeeRMB 
,SUM((SalesPrice+TransportPay+SalesRefunds+PromotionRebates+OtherCredits+ISNULL(Tax,0)+ISNULL(MarketplaceFacilitatorTax,0))/USD_ExchangeRMB) SalesPriceFeeUSD
,SUM(SalesRefunds) FundMoneyRMB
,SUM(SalesRefunds/USD_ExchangeRMB) FundMoneyUSD
    ,ABS(SUM((CASE WHEN ISNULL(SalesRefunds,0)=0 THEN 0 ELSE ISNULL(SalesRefunds,0)+ISNULL(PromotionRebates,0)+ISNULL(OtherCredits,0)+ISNULL(Tax,0)+ISNULL(MarketplaceFacilitatorTax,0) END))) SalesRefundsV2RMB
    ,ABS(SUM((CASE WHEN ISNULL(SalesRefunds,0)=0 THEN 0 ELSE ISNULL(SalesRefunds,0)+ISNULL(PromotionRebates,0)+ISNULL(OtherCredits,0)+ISNULL(Tax,0)+ISNULL(MarketplaceFacilitatorTax,0) END)/USD_ExchangeRMB)) SalesRefundsV2USD
from RB_Report_OrderSettlement with(nolock)
where CustomerID=1 and ShipDate>='2025-07-01' and ShipDate<DATEADD(DAY,1,'2025-07-28') and BusinessTeamID in (223) and WareHouseID in (334,332,338,337,339,326,318,319,320,52,59,3483,79,23,40,24,6297,26

仓库



,24471,24469,24468,24467,24470,14677,14675,19679)
)AS tmporder GROUP BY tmporder.CustomerID,SalesWeek,tmporder.BusinessTeamID,tmporder.BusinessTeamName
) AS ordernum on ordernum.CustomerID=orderfee.CustomerID and ordernum.BusinessTeamID=orderfee.BusinessTeamID and orderfee.BusinessTeamName=ordernum.BusinessTeamName 
and ordernum.SalesWeek=orderfee.DateToday
order by orderfee.BusinessTeamID,orderfee.DateToday asc
MESSAGE:The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.
TRACE:   在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   在 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   在 System.Data.SqlClient.SqlDataReader.get_MetaData()
   在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
   在 GotDotNet.ApplicationBlocks.Data.AdoHelper.ExecuteDataset(IDbCommand command)
   在 Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(SqlCommand command)
   在 PandaBuy.ERP.DAL.DBOperator.GetDSExecuteSqlNoTimeOut(String p_Sql, Boolean IsWriteDB)   在 PandaBuy.ERP.DAL.DBOperator.E8mARE5em(SqlException  , String  )
   在 PandaBuy.ERP.DAL.DBOperator.GetDSExecuteSqlNoTimeOut(String p_Sql, Boolean IsWriteDB)
   在 PandaBuy.ERP.Web.ASHX.IrobotBox.SalesTeamDateReportHandler.ProcessRequest(HttpContext context)
   在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
   在 System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
   在 System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
   在 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
   在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
   在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

[结果]


[期望]

排查 并修复故障 怎么有这么多 仓库ID  导致SQL异常了 
历史记录  
  1. 2025-07-28 19:56:08, 由 袁慧斌 创建。
  2. 2025-07-28 20:08:36, 由 李乐同 指派给 张明磊。
    修改了 指派给,旧值为 "liletong",新值为 "zhangminglei"。
  3. 2025-07-29 14:01:38, 由 张明磊 解决,方案为 性能问题 。
    修改了 解决方案,旧值为 "",新值为 "performance"。
    修改了 解决日期,旧值为 "",新值为 "2025-07-29 14:01:06"。
    修改了 指派给 ,旧值为 "zhangminglei",新值为 "linhen"。
    修改了 Bug状态 ,旧值为 "active",新值为 "resolved"。
    修改了 是否确认,旧值为 "0",新值为 "1"。
    修改了 解决者 ,旧值为 "",新值为 "zhangminglei"。

    页面是订单利润报表(销售小组),订单利润已切换V2,产品这边安排下关闭菜单入口

  4. 2025-07-29 15:47:44, 由 林很 激活。
    修改了 Bug状态 ,旧值为 "resolved",新值为 "active"。
    修改了 激活日期,旧值为 "",新值为 "2025-07-29 15:47:44"。
    修改了 激活次数,旧值为 "0",新值为 "1"。
    修改了 解决方案,旧值为 "performance",新值为 ""。
    修改了 解决日期,旧值为 "2025-07-29 14:01:06",新值为 "0000-00-00"。
    修改了 解决者 ,旧值为 "zhangminglei",新值为 ""。
    修改了 关闭日期,旧值为 "",新值为 "0000-00-00"。
  5. 2025-07-29 15:49:22, 由 林很 转为 需求,编号为 #30068 【订单利润】关闭订单利润销售小组报告和人员维度报告 。
  6. 2025-07-29 15:49:22, 由 林很 关闭。
所属项目 技术中心-需求池
所属模块 财务   财务管理
所属计划
所属迭代
Bug类型
严重程度 一般
优先级 P2
Bug状态 已关闭
业务部门
影响功能
开发责任人 林很
测试责任人
解决时效 0
激活次数 1
激活日期 2025-07-29 15:47:44
是否确认 是
当前指派 Closed 于 2025-07-29 15:49:22
截止日期 0000-00-00
上线时间
上线时效
操作系统
浏览器
关键词
抄送给
所属迭代
相关需求
相关任务
由谁创建 袁慧斌 于 2025-07-28 19:56:08
影响环境 测试环境-测试反馈
由谁解决 林很 于 2025-07-29 15:49:22
解决版本
解决方案 tostory
由谁关闭 林很 于 2025-07-29 15:49:22
最后修改 林很 于 2025-07-29 15:47:44