Opened 2 years ago

Last modified 21 months ago

#18669 new Bug

QuerySet.bulk_create should batch if no AutoField

Reported by: jdunck Owned by: jdunck
Component: Database layer (models, ORM) Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


.bulk_create branches on can_combine_inserts_with_and_without_auto_increment_pk *and* _meta.has_auto_field, but it should be
can_combine_inserts_with_and_without_auto_increment_pk or not _meta.has_auto_field.

This buglet means that even if the model doesn't have an autofield, the list will be partitioned into models with and without the PK, resulting in unnecessary query executions.

I'm assigning myself as owner because I intend to patch it.

Attachments (0)

Change History (1)

comment:1 Changed 21 months ago by akaariai

  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Bug

Looks like a bug to me.

Add Comment

Modify Ticket

Change Properties
<Author field>
as new
The owner will be changed from jdunck to anonymous. Next status will be 'assigned'
as The resolution will be set. Next status will be 'closed'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.