Skip to content

Faster bulk_create using dictionaries #113

@adamsol

Description

@adamsol

Code of Conduct

  • I agree to follow Django's Code of Conduct

Feature Description

Allow QuerySet.bulk_create to accept dictionaries in addition to model instances. This would be symmetrical to QuerySet.values.

Problem

Creating model instances is expensive and significantly slows down bulk-inserting data. By using dictionaries, we can avoid this bottleneck.

Request or proposal

proposal

Additional Details

Forum discussion

Implementation Suggestions

As linked in the forum, here's a tentative implementation that I prepared: adamsol/django@ed1ad9c. It would mostly require tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Idea

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions