Today, Christophe Pettus wrote about an easy way to get better database performance from a ForeignKey reference.
Don’t do:
pub_id = b.publisher.id
Do do:
pub_id = b.publisher_id
After you read his post, you’ll think, “But of course!” Joe Bob says check it out.
There is nothing I like more than a
one-character performance fix!