RB_Ebay_Listing_ReturnPolicy_V2 未归档 ebay listing
RB_Ebay_Listing_Basic_V2 未归档 ebay listing
E_Ebay_CompatibilityValues 未归档 ebay listing
RB_Ebay_Listing_Product_Sales_V2 未归档 ebay listing
RB_Ebay_ItemID_AutoSupplement_V2 未归档 #N/A
RB_Ebay_ItemID_ShipStrategy_V2 未归档 #N/A
RB_Ebay_Listing_VariationAttribute_V2 未归档 ebay listing
RB_Ebay_Listing_30TianSiteChuDan 未归档 #N/A
RB_Ebay_Listing_30TianSiteChuDan 未归档 #N/A
RB_Ebay_Listing_30TianChuDan 未归档 #N/A
RB_Ebay_Listing_ProductAttribute_V2 未归档 ebay listing

运维梳理工作:
系统部要求整理数据量超大的数据表,写出用于归档的SQL,符合条件的数据将被移出数据表另外保存,
sql切记谨慎,确保移除的数据不影响现有业务逻辑。
原则如下三类数据:
1、如果是按时间范围的,只保留24个月
2、有明确可删除的数据,可直接给出delete
3、涉及父子表进行归档的,都可以写出来。子表的归档可根据父表的ID关连归档
RB_Ebay_Listing_ProductAttribute_V2 无需归档
RB_Ebay_Listing_30TianSiteChuDan 无需归档
RB_Ebay_Listing_30TianChuDan 无需归档
select COUNT(1) from RB_Ebay_Listing_Basic_V2 (nolock) where OnlineState = -1 and UpdateTime < DATEADD(MONTH,-3,GETDATE());
select count(1) from RB_Ebay_Listing_ReturnPolicy_V2 (nolock) sub
left join RB_Ebay_Listing_Basic_V2 (nolock) b on sub.ListingBasicID = b.ListingBasicID
where b.OnlineState = -1 and b.UpdateTime < DATEADD(MONTH,-3,GETDATE());
select count(1) from RB_Ebay_Listing_Product_Sales_V2 (nolock) sub
left join RB_Ebay_Listing_Basic_V2 (nolock) b on sub.ListingBasicID = b.ListingBasicID
where b.OnlineState = -1 and b.UpdateTime < DATEADD(MONTH,-3,GETDATE());
select count(1) from RB_Ebay_Listing_VariationAttribute_V2 (nolock) sub
left join RB_Ebay_Listing_Basic_V2 (nolock) b on sub.ListingBasicID = b.ListingBasicID
where b.OnlineState = -1 and b.UpdateTime < DATEADD(MONTH,-3,GETDATE());
select count(1) from RB_Ebay_ItemID_AutoSupplement_V2 (nolock) sub
left join RB_Ebay_Listing_Basic_V2 (nolock) b on sub.ItemID = b.ItemID
where b.OnlineState = -1 and b.UpdateTime < DATEADD(MONTH,-3,GETDATE());
select count(1) from RB_Ebay_ItemID_ShipStrategy_V2 (nolock) sub
left join RB_Ebay_Listing_Basic_V2 (nolock) b on sub.ItemID = b.ItemID
where b.OnlineState = -1 and b.UpdateTime < DATEADD(MONTH,-3,GETDATE());
因为业务需要查询历史数据,所以程序还需要适配开发