2
我有一個巨大的表(幾十億行)與聚集索引和兩個非聚集索引。SQL Server 2008 BULK INSERT導致讀取次數多於寫入次數。爲什麼?
BULK INSERT操作產生112000次讀取,只有383次寫入(持續時間爲19948ms)。
這讓我非常困惑。爲什麼讀取超過寫入?我怎樣才能減少它?
更新 查詢
insert bulk DenormalizedPrice4 ([DP_ID] BigInt, [DP_CountryID] Int, [DP_OperatorID] SmallInt, [DP_OperatorPriceID] BigInt, [DP_SpoID] Int, [DP_TourTypeID] Int, [DP_CheckinDate] Date, [DP_CurrencyID] SmallInt, [DP_Cost] Decimal(9,2), [DP_FirstCityID] Int, [DP_FirstHotelID] Int, [DP_FirstBuildingID] Int, [DP_FirstHotelGlobalStarID] Int, [DP_FirstHotelGlobalMealID] Int, [DP_FirstHotelAccommodationTypeID] Int, [DP_FirstHotelRoomCategoryID] Int, [DP_FirstHotelRoomTypeID] Int, [DP_Days] TinyInt, [DP_Nights] TinyInt, [DP_ChildrenCount] TinyInt, [DP_AdultsCount] TinyInt, [DP_TariffID] Int, [DP_DepartureCityID] Int, [DP_DateCreated] SmallDateTime, [DP_DateDenormalized] SmallDateTime, [DP_IsHide] Bit, [DP_FirstHotelAccommodationID] Int) with (CHECK_CONSTRAINTS)
沒有觸發&外鍵 簇索引由DP_ID 和兩個非唯一索引(與填充因子= 90%)
還有一件事DB存儲在RAID50條紋大小爲256K
沒有足夠的細節來準確回答...但是插入必須閱讀才能找到正確的插入位置... –
需要什麼樣的細節? – sh1ng
您執行的實際SQL語句以及表結構將有所幫助..... –