There are often diffraction problems when the lens is closed down too much. It is often best to shut down at least one step from the maximum. There is another important consideration in depth of field, and that is where you focus. In general, twice as much is in focus in the area beyond your focal point as in the area closer to you. What that means, is that you focus one third into your frame. That is not one third into the real distance in miles or kilometres, but one third into the photo you are framing in Live View (which BTW gives more accurate focusing). There are hyperfocal calculators galore available as apps, but if you frame your photo well (always the number one consideration), use a tripod and remote release, use a higher aperture (f/11, 13, 16 or 18) and focus one third into your frame, you're on the right track.
I tried to upload some samples but for some reason LR won't let me export a 1000 kb image. I have some Palouse landscape photos on my flickr account, generally taken at f/11.
https://www.flickr.com/photos/stephenlustig/