just too slow using the select loop with limit function