Hello. I think I understand it all now.
Thank you, Ladislav Lenart On 26.4.2013 13:22, Gunnlaugur Thor Briem wrote: > No, the comma is supposed to be there; it's for tuple unpacking. The iterable > q > yields tuples (which in this case are of length one, because the resultset has > only one column). > > The column should be whatever attribute of the ORM instances you want to sort > by, not necessarily the primary key. > > The ORM instances are referenced by the session, so they will not be reclaimed > until the session is closed (or they are expunged from it). > > Regards, > > Gulli > > > > On Fri, Apr 26, 2013 at 10:06 AM, Ladislav Lenart <[email protected] > <mailto:[email protected]>> wrote: > > Hello. > > I have found this recipe: > > http://www.sqlalchemy.org/trac/wiki/UsageRecipes/WindowedRangeQuery > > I think it fits perfectly for my usecase: process potentially large > result set > of ORM instances in chunks of predefined size to limit memory consumption. > > I have few questions / remarks: > * I think there is a typo in the line (the comma should not be there, > right?): > intervals = [id for id, in q] > * The column supplied to windowed_query() function should be the primary > key of > the table that represents the ORM instances, right? > * When are the ORM instances from the previous chunk reclaimed? I know the > session keeps them in an identity map. > > > Thank you, > > Ladislav Lenart > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:sqlalchemy%[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email > to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
