任务描述
ODE:N083638915
Error:11_-2_0_-2146232060
SQL:DELETE RB_Amazon_Product_Base
WHERE OrderSourceSKUID IN (SELECT CONVERT(INT, item) FROM Charsplitforin(@OrderSourceSKUIDs, ','))
AND CustomerID = @CustomerID
AND OrderSourceID=@OrderSourceID
PARAMS:@OrderSourceSKUIDs = 917483574,918266608,917208530,918379153,917605334,918515860,917202673,918266600,919181450,917582237,918529345,919193186 ,@CustomerID = 1 ,@OrderSourceID = 5630 ,
MESSAGE:执行超时已过期。完成操作之前已超时或服务器未响应。
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.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.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)    在 System.Data.SqlClient.SqlCommand.ExecuteNonQuery()    在 RB.DAL.DBOperator.ExecuteSql(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms)   在 RB.DAL.DBOperator.toCommonTipException(SqlException ex, String sql, SqlParameter[] cmdParms)    在 RB.DAL.DBOperator.ExecuteSql(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms)    在 RB.DALExtendV2.RB_Amazon_Product_BaseExtendV2.DeleteListByIDList(List`1 idList, Int32 customerID, Int32 orderSourceID)    在 Biz.Irobotbox.Amazon.AutoPublish.Amazon_AutoPublish_PublishListing_Delete.AutoPublishOrderSourceProductExecute(CM_Amazon_AutoPublish_OrderSource_Product autoPublishOrderSource)    在 RB.Utility.TaskSmartManager`1.execute(Func`2 execFunction)    在 System.Threading.Tasks.Task.Execute()    在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)    在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)    在 System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)    在 System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)    在 System.Threading.ThreadPoolWorkQueue.Dispatch()


优化建议:

DECLARE @OrderSourceSKUIDs VARCHAR(max)= '917483574,918266608,917208530,918379153,917605334,918515860,917202673,918266600,919181450,917582237,918529345,919193186',
        @CustomerID        INT= 1,
        @OrderSourceID     INT= 5630,
        @nMaxid int=0,
        @nRows int=1;
drop table if exists #tabIds;
select id into #tabIds from RB_Amazon_Product_Base nolock
WHERE  OrderSourceSKUID IN (SELECT CONVERT(INT, item)
                            FROM   Charsplitforin(@OrderSourceSKUIDs, ','))
       AND CustomerID = @CustomerID
       AND OrderSourceID = @OrderSourceID ;
create index idx_id on #tabIds(id);
while @nRows>0
begin
    select top 500 id into #tabA from #tabIds where id>@nMaxid order by id;
    set @nRows=@@ROWCOUNT;
    create index idx_id on #tabA(id);
    select @nMaxid=max(id) from #tabA;    
    delete p from RB_Amazon_Product_Base p inner join #tabA t on p.id=t.id;
    drop table if exists #tabA;
end;


drop table if exists #tabIds;



历史记录  
  1. 2023-03-03 09:40:15, 由 吴高发 创建。
  2. 2023-03-03 15:33:18, 由 彭康 指派给 魏鹏军。
    修改了 指派给 ,旧值为 "wangxiangyu",新值为 "weipengjun"。
    修改了 预计剩余,旧值为 "0",新值为 "8"。
  3. 2023-03-06 14:27:42, 由 魏鹏军 完成。
    修改了 总计消耗,旧值为 "0",新值为 "0.5"。
    修改了 指派给 ,旧值为 "weipengjun",新值为 "wugaofa"。
    修改了 实际完成,旧值为 "",新值为 "2023-03-06 11:47:27"。
    修改了 任务状态,旧值为 "wait",新值为 "done"。
    修改了 实际开始,旧值为 "0000-00-00 00:00:00",新值为 "2023-03-06 11:49:15"。
    修改了 预计剩余,旧值为 "8",新值为 "0"。
    修改了 由谁完成,旧值为 "",新值为 "weipengjun"。

    已按照表值参数修改

    涉及点:自动刊登listing定时删除(针对刊登失败listing,只保留近10天的数据)

    如下:

  4. 2023-03-07 14:12:44, 由 吴高发 关闭。
    修改了 任务状态,旧值为 "done",新值为 "closed"。
    修改了 指派给 ,旧值为 "wugaofa",新值为 "closed"。
    修改了 由谁关闭,旧值为 "",新值为 "wugaofa"。
    修改了 关闭时间,旧值为 "0000-00-00 00:00:00",新值为 "2023-03-07 14:12:44"。
    修改了 关闭原因,旧值为 "",新值为 "done"。
所属迭代 系统管理部 - 系统服务优化
所属模块 /
相关需求 暂无
指派给 Closed 于 2023-03-07 14:12:44
任务类型 后端
任务标签 初始
开发组 运营开发组
任务状态 已关闭
进度 100%
优先级 P2
关键词
抄送给
由谁创建 吴高发 于 2023-03-03 09:40:15
由谁完成 魏鹏军 于 2023-03-06 11:47:27
由谁取消 暂无
由谁关闭 吴高发 于 2023-03-07 14:12:44
关闭原因 已完成
最后编辑 吴高发 于 2023-03-07 14:12:44
团队 最初预计 总计消耗 预计剩余
工时信息
最初预计 0工时
总计消耗 0.5工时
预计剩余 0工时
预计开始 0000-00-00
实际开始 2023-03-06
截止日期 0000-00-00