Stopping down as far as possible in pursuit of DOF is indeed not a very good idea.
It will indeed reduce sharpness visibly.
But not increase DOF by enough to be useful.