Vr convert rec algos to sql