(via http://python.ie/pycon/2013/talks/denormalizing_the_django_orm/)
Speaker: Sean Blanchfield (http://twitter.com/seanblanchfield)
An ORM can make database programming a pleasure. Unfortunately, they can also land you in a lot of trouble when you go live and find out that you can handle about 1 request per second. In this talk, I share our experience porting Utopia-Game.com to Django. We fully normalized a huge database schema, and discovered too late that each page load was generating hundreds of queries. Unable to refactor all the code in production, we dusted off our meta class magic skills, and extended the Django ORM to create the DenormalizedModel, which walked and talked like a normal Django Model class, but which sucked all the class's foreign key relationships in to one big BLOB field.
In this talk I'll walk through the problem and our solution, and share the code with the audience.