@@ -630,12 +630,16 @@ void LoadSmallTables(
630630 ExecuteWithRetry (" LoadItems" , [&]() {
631631 return LoadItems (tableClient, itemTablePath, arena, fastRng, Log);
632632 }, arena, Log);
633- ExecuteWithRetry (" LoadWarehouses" , [&]() {
634- return LoadWarehouses (tableClient, warehouseTablePath, 1 , warehouseCount, arena, fastRng, Log);
635- }, arena, Log);
636- ExecuteWithRetry (" LoadDistricts" , [&]() {
637- return LoadDistricts (tableClient, districtTablePath, 1 , warehouseCount, arena, fastRng, Log);
638- }, arena, Log);
633+
634+ for (int wh = 1 ; wh <= warehouseCount; wh += MAX_WAREHOUSES_PER_IMPORT_BATCH) {
635+ int lastId = Min (wh + MAX_WAREHOUSES_PER_IMPORT_BATCH - 1 , warehouseCount);
636+ ExecuteWithRetry (" LoadWarehouses" , [&]() {
637+ return LoadWarehouses (tableClient, warehouseTablePath, wh, lastId, arena, fastRng, Log);
638+ }, arena, Log);
639+ ExecuteWithRetry (" LoadDistricts" , [&]() {
640+ return LoadDistricts (tableClient, districtTablePath, wh, lastId, arena, fastRng, Log);
641+ }, arena, Log);
642+ }
639643}
640644
641645// -----------------------------------------------------------------------------
0 commit comments