The pedigree query will give complete inbreeding statistics for the number of generations you are currently viewing. The notation such as 4S x 5D lets you know the generation and location in the pedigree that the inbred horse appears. 4S means that the horse appears on in the 4th generation on the sires half of the pedigree. 5D means in the 5th generation on the dam's half of the pedigree.
Each inbred ancestor is assigned a random color so that you can easily locate the pairs in the pedigree. This is useful for 5 or 6 generation pedigrees. Beyond 6 generations, the color coding is pretty useless because of all the inbreeding that usually occurs. If two colors appear the same, it's totally coincidental and you can get a new set of random colors by reloading the pedigree.
Also remember, pink squares are used for females and blue squares for males.
Sometimes you'll also see a lower case 'd' or 's'. This means that the inbreeding is occurring through a female ancestor. An uppercase letter denotes that the inbreeding is occurring through a male ancestor.