How can I optimize this Django query to get faster result? – Mysql
items = Items.objects.filter(active=True) price_list = [] for item in items: price = Price.objects.filter(item_id = item.id).last() price_list.append(price) Price model can have multiple entry for single item, I have to pick last element. How can we optimize above query to avoid use…