#36088: Avoid unnecessary DEFAULT usage on bulk_create for models with
db_default
fields
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Simon
Type: | Charette
Cleanup/optimization | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: unnest insert | Triage Stage: Ready for
db_default default bulk_create | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):
* resolution: => fixed
* status: assigned => closed
Comment:
In [changeset:"4608d34b346c28d5d227363c881d3279378f40b3" 4608d34b]:
{{{#!CommitTicketReference repository=""
revision="4608d34b346c28d5d227363c881d3279378f40b3"
Fixed #36088 -- Avoided unnecessary DEFAULT usage on bulk_create().
When all values of a field with a db_default are DatabaseDefault, which
is the case most of the time, there is no point in specifying explicit
DEFAULT for all INSERT VALUES as that's what the database will do anyway
if not specified.
In the case of PostgreSQL doing so can even be harmful as it prevents
the usage of the UNNEST strategy and in the case of Oracle, which
doesn't support the usage of the DEFAULT keyword, it unnecessarily
requires providing literal db defaults.
Thanks Lily Foote for the review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36088#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070194c2c9758c-60aebaf5-e8a0-4bf1-8438-7c1afa768104-000000%40eu-central-1.amazonses.com.