You probably realize that a small aperture will provide you with the most depth-of-field, but stopping ALL the way down to your smallest aperture (usually the largest number, i.e., f/16, f/22, etc.) is not typically a good idea. Many lenses perform best at one or two stops shy of their smallest aperture. As you stop down from there, performance suffers. This is because of diffraction.