diff --git a/apps/contacts/lib/app.php b/apps/contacts/lib/app.php
index 25461877e627c00445605b3c8b7df7f0f2cc4383..f125ec0293ccce6c3c6e8d5d2fc2a9bdad53acd4 100644
--- a/apps/contacts/lib/app.php
+++ b/apps/contacts/lib/app.php
@@ -196,16 +196,19 @@ class OC_Contacts_App {
 				foreach($vcaddressbooks as $vcaddressbook) {
 					$vcaddressbookids[] = $vcaddressbook['id'];
 				}
-				$vccontacts = OC_Contacts_VCard::all($vcaddressbookids);
-			}
-		}
-		if(is_array($vccontacts) && count($vccontacts) > 0) {
-			$cards = array();
-			foreach($vccontacts as $vccontact) {
-				$cards[] = $vccontact['carddata'];
+				$start = 0;
+				$batchsize = 10;
+				while($vccontacts = OC_Contacts_VCard::all($vcaddressbookids, $start, $batchsize)){
+					$cards = array();
+					foreach($vccontacts as $vccontact) {
+						$cards[] = $vccontact['carddata'];
+					}
+					OCP\Util::writeLog('contacts',__CLASS__.'::'.__METHOD__.', scanning: '.$batchsize.' starting from '.$start,OCP\Util::DEBUG);
+					// only reset on first batch.
+					self::getVCategories()->rescan($cards, true, ($start==0?true:false));
+					$start += $batchsize;
+				}
 			}
-
-			self::$categories->rescan($cards);
 		}
 	}