I don't remember where I saw this, but I remember reading something about each user costing Facebook about $8 a year due to all the complex DB querying they do.
That'd probably shrink if they didn't need targeted advertising, but a lot of the complex friend graphs might result in some hefty computation at scale.