getRandomPrimaryKeys only returns results if results should be returned.