Google own Youtube.
Youtube know every IP address that logs on and what they watch, of course. How long they keep that information I don't know.
Viacom don't want to know what any one person watched - they want statistics to see how much copyright material is made available and how much it is watched.
Google can also keep records of what is searched for, of course.
Viacom can only know the information on records that Google/Youtube pass to them - the last I read was that personal information (ie IP addresses)were not to be handed over)
Summary of the case click here