Subject Re: how do i speed this up
Author martinknappe
> I think maybe:
>
> > select first 1 id from dicentries where (asterm = :currentasterm
> > and id >= :currentid) order by id ascending into :idout;
>
> If none found, idout will be null

This doesnt really make sense. I am making sure that the id really
exists with

select min(asterm) from dicentries where (asterm = :priorasterm
and id >= :currentid) or (asterm > :priorasterm) into :currentasterm;

BEFORE selecting it with

select first 1 id from dicentries where (asterm = :currentasterm
and id >= :currentid) order by id ascending into :idout;