Re: Potential performance related bug in django`s Queryset.get().

2020-01-02 Thread Anudeep Samaiya
Thanks for the revert, I completely agree with both of your explanations. Thanks Anudeep Samaiya > On 02-Jan-2020, at 21:51, charettes wrote: > > Hey there! > > The current code assumes that .get() will likely match one result which > should be the case > most of t

Potential performance related bug in django`s Queryset.get().

2020-01-02 Thread Anudeep Samaiya
ET_RESULTS clone.query.set_limits(high=limit) -num = len(clone) +num = clone.count() if num == 1: +clone._fetch_all() return clone._result_cache[0] if not num: raise self.model.DoesNotExist( Thanks Anudeep Samaiya -- Yo