We study sub-Riemannian (Carnot-Caratheodory) metrics defined by
noninvolutive distributions on real-analytic Riemannian manifolds.
We establish a connection between regularity properties of these
metrics and the lack of length minimizing abnormal geodesics.
Utilizing the results of the previous study of abnormal length
minimizers accomplished by the authors in [Annales IHP. Analyse
nonlinéaire 13, p. 635-690] we describe in this
paper two classes of the germs of distributions (called
2-generating and medium fat) such that the corresponding
sub-Riemannian metrics are subanalytic. To characterize these
classes of distributions we determine the dimensions of the
manifolds on which generic germs of distributions of given rank
are respectively 2-generating or medium fat.