On Fri, Jun 24, 2011 at 2:34 AM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> On Fri, Jun 24, 2011 at 9:28 AM, Cal Leeming [Simplicity Media Ltd]
> <cal.leem...@simplicitymedialtd.co.uk> wrote:
> > +1 on this new feature.
> > For those that don't understand how this impacts performance, I'm
> dedicating
> > a chunk of the (soon to come) webcast to explaining how this works and
> the
> > future ideas for monkey-patching the ORM with deferred execution (which
> > basically means to make this a 99% drop-in replacement).
> > For those testing this new DSE feature, please remember to use manual
> > transactions, perform dryrun's first, and keep the chunk size low (as
> these
> > are all factors which need to be changed based on what your data is, and
> > what you are doing with it).
>
> For the record, Alex Gaynor prepared a patch at DjangoCon Europe that
> adds bulk inserts to Django's ORM.
>
> http://paste.pocoo.org/show/404031/
>
> In brief, it means that:
>
>    >>> Entry.objects.bulk_create([
>    ...     Entry(headline="Django 1.0 Released"),
>    ...     Entry(headline="Django 1.1 Announced"),
>    ...     Entry(headline="Breaking: Django is awesome")
>    ... ])
>

Oh, that's a big game changer then. If bulk_create() is considered for the
core, then that means we have a real good chance of getting bulk_update()
considered too. But, some thought would need to go into how the syntax
looks.. My guess is it would either be a monkey patch with some defers, then
a call to bulk_update() at the end (how the hell this would work into
automated transaction management I don't know). Or, it'd be a set of new
functions (i.e. start_bulk_update(), add_bulk_update(),
execute_bulk_update() ), or something like that..

Russell, should we get a ticket created for bulk_update to discuss how this
should be done? Or should a proposal be drawn up first and submitted for
comments?


> will insert three objects with a single SQL INSERT statement (there
> are a couple of other caveats; see the patch for details and docs).
>
> The upside to this -- using bulk inserts for just the permissions
> table resulted in a 30% speedup for the PostgreSQL test suite.
>
> The patch has been sitting in my review pile since the conference; as
> soon as I get a few spare seconds to scratch myself, I intend to
> review it so we can get it into trunk. If anyone else wants to review,
> they're most welcome to do so.
>
> Yours,
> Russ Magee %-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to