Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
working from home today as I had a few things to resolve. One was taking pooch to the groomers
The other job was supposedly taking delivery of new phone, however EE/DPD have screwed up the dates twice now.
So when I do get new phone, it will be being sent back and upgrade cancelled.
This thing I'm mucking about with was rather slow on the view that I use most as it's traversing several relationships and Django (quite rightly) doesn't try to make any assumptions and waste effort optimising stuff that might not need to be optimised. I'd been meaning to look at this for ages, as I knew what needed doing.
So I've just added .select_related('tweet', 'domain', 'tweet__user') to the get_queryset() method, and reduced the number of database queries per page of 50 items from 102 to 2
One of those is getting the count for the pagination and takes hardly any time, so I don't think I need bother trying to optimise it down to 1
Comment