Solve N+1 in raffles index on ranks