A lot of people care about depth of field, often wanting to minimize it to create that smooth, blurry background and pristine bokeh. Most think about aperture, f-number, when they think of controlling depth of field; slightly fewer remember that you can also change your focal length or how close you're focusing, but it's often an afterthought: I mean,
how much effect does it really have?
In fact, changing your distance or focal length actually affects your depth of field
much more than simply changing the f-number (both behave quadratically, while the f-number has only a linear effect [see below], but if that makes your head hurt, don't worry about it!). Though these changes likely mean a slight change in composition in the photo, if you are dying for just the narrowest DoF you can get, keep this in mind!
In other words: If you really want to blur out the out of focus regions, don't just think about aperture, but consider getting closer or using a longer lens (the inverse is true as well)!
-----------------End of Tip (for submission). What follows is a slightly more thorough explanation of the math mentioned above, for completeness
-------------
So, it turns out there's a formula for the total depth of field in your image, which can be given by (prepare yourselves, MATH incoming):
Total DoF = 2 N c u^2 / f^2
Where N is the f-number, u is the distance to your focal plane, and f is your focal length. (c is your "circle of confusion," but for here, it's easiest just to think of it as a constant; if you're more interested, I encourage you to look it up, or send me a message and I'd be happy to explain!).
*Note: This formula is a slight simplification from a full solution, but is very accurate for nearly all use cases, and highlights very effectively the point made. (Also, I would love to format this, but I can't seem to find any good formatting tools here.)
What we see is something really notable, and that's that the f-number is a purely linear term, while the focus distance and the focal length are both quadratic! Said differently, a change in f-number is very quickly trumped by a change in either of the others.
ex: u = 5 m, N = 8, f = 55 mm, and c is constant, say c = 10 microns, for simplicity.
For this initial setup, we get a total DoF = 1.3 m. That means that things won't even start to blur until you're almost a meter behind your subject.
Now, if we go to N = 2.8 (a whole 3 stops to compensate!) we get DoF = 0.46 m.
Not bad, but I think we can do better. Say I want to keep things at f/8 for maximal sharpness in the in-focus parts, how can I achieve this same depth of field? Well, without moving at all or changing the f-number, if I zoom out (say on a handy-dandy 55-300 HD) to 93mm, I achieve the exact same DoF!
But if I really preferred how the 55mm treated the scene, I could instead move a little closer! Taking 3 steps up to being 3m away achieves again the same effect.
But if I take a little of each, and shoot 85mm at f/4 from only one meter closer (4m away), I achieve a wonderfully shallow DoF = 0.177m, less than half what we had with just switching to f/2.8, and almost ten times less than what we started with!
PHEW. That's a lot of math. But yes, the point is, DoF is far from an aperture-driven effect!