> Den 16/09/2015 kl. 19.08 skrev Simon Charette :
>
> If you want to use this approach I'm afraid you'll have to do
> what prefetch_related does under the hood by yourself.
>
> e.g.
>
> from collections import defaultdict
>
> prefetched = defaultdict(list)
> subjects =
> Den 17/09/2015 kl. 09.22 skrev Javier Guerra Giraldez :
>
> On Thu, Sep 17, 2015 at 2:07 AM, Erik Cederstrand
> wrote:
>>> Den 16/09/2015 kl. 16.45 skrev Mike Dewhirst :
>>>
>>> On 16/09/2015 9:53 AM, Erik Cederstrand
On Thu, Sep 17, 2015 at 2:07 AM, Erik Cederstrand
wrote:
>> Den 16/09/2015 kl. 16.45 skrev Mike Dewhirst :
>>
>> On 16/09/2015 9:53 AM, Erik Cederstrand wrote:
>>> issues because the prefetch query does something along the lines of
>>> "SELECT ...
> Den 16/09/2015 kl. 16.45 skrev Mike Dewhirst :
>
> On 16/09/2015 9:53 AM, Erik Cederstrand wrote:
>> Hi folks,
>>
>> I'm working on a school timetable app. I want to fetch hundreds of
>> thousands of Lesson instances with prefetched m2m relations (e.g.
>> subjects). My
On 16/09/2015 9:53 AM, Erik Cederstrand wrote:
Hi folks,
I'm working on a school timetable app. I want to fetch hundreds of
thousands of Lesson instances with prefetched m2m relations (e.g.
subjects). My m2m relations use through models (I'm not sure this
actually makes a difference here), and
Hi Erik,
I think the prefetch api uses IN [id1, ..., idn] instead of IN (SELECT *
...)
because the default isolation level Django runs with is READ COMITTED
and using the latter could return different results for the second query.
e.g.
SELECT id FROM foo WHERE bar = true;
-- An other
Hi folks,
I'm working on a school timetable app. I want to fetch hundreds of thousands of
Lesson instances with prefetched m2m relations (e.g. subjects). My m2m
relations use through models (I'm not sure this actually makes a difference
here), and I'm running into performance issues because
7 matches
Mail list logo