Opened 11 years ago

Closed 6 years ago

Last modified 5 years ago

#661 closed enhancement (wontfix)

New function: batch save of objects would make for more efficient processing

Reported by: Lllama Owned by: adrian
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Currently new records are saved one at the time using save(). In most cases this is sufficient though a batch save method would allow for more efficient database access when appropriate.

An example: An app allows the upload of a file which is parsed into many records. Currently each record would have to be looped over and save()d. A function which took the list of records and did One Big Insert would make the operation more efficient.

Change History (5)

comment:1 Changed 11 years ago by hugo

actually even when collecting stuff you need to do separate inserts, as every record corresponds to one row in the database and such requires one insert. Things like COPY FROM aren't standard and so shouldn't really be used. And with transactions you will have "bundled updates" anyway, as the database internally handles when to move stuff into the tables.

comment:2 Changed 11 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to closed

This is outside the scope of Django -- feel free to use your database server's batch save functionality, such as COPY FROM.

comment:3 Changed 6 years ago by speedplane

  • Resolution wontfix deleted
  • Status changed from closed to reopened

This would really nice to fix. At least as a feature request. Could you take another look at this. Take a look at what some people are doing:

I would also say that this is within the scope of django. The idea is to use as little SQL as possible (ideally none).

comment:4 Changed 6 years ago by PaulM

  • Needs documentation set
  • Resolution set to wontfix
  • Status changed from reopened to closed

While I agree that this might be useful functionality, re-opening a ticket which was closed by a core dev as "wontfix" (even when that was 4 years ago) isn't the way to get your request considered. Instead, you should start a thread about it on the django-dev mailing list.

Please review the documentation about how we use Trac:

I'm re-closing this ticket.

comment:5 Changed 5 years ago by kmtracey

  • Easy pickings unset
  • UI/UX unset

Just a note, while this one was closed wontfix the request was made again in #7596 and that one was fixed.

Note: See TracTickets for help on using tickets.
Back to Top