I had a whole set of comments about concerns about doing this to a large table in prod, and statistics and such - then I read about hypopg.
What a neat package, learned something new today.