Improving performance using select_related