The Wiki page on "gotra" suggests they "only" have to go back seven generations (I don't know any of my ancestors beyond five generations and the father of one of my great-grandfathers was never known; would that be scandalous in India?), which seems to imply extreme complication. If each female ancestor has her own unique gotra, in seven generations there would be 64 gotras. Unless there are thousands of gotras, it must be very common for a prospective bride and groom to overlap. Little wonder that arranged marriages are common.