select greatest(max(t1.id), max(t2.id)) from t1, t2;
I seriously doubt that the greatest function is a larger contributor to run time than the cross join between t1 and t2.
David J.
select greatest(max(t1.id), max(t2.id)) from t1, t2;