﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28231	bulk_create: avoid iterating `objs` more than necessary when `bulk_size` is provided	Nir Izraeli	nobody	"When `bulk_size` provided in `bulk_create`, a user might assume (As I myself have) that `objs` iterable will not be iterated more than `bulk_size` times at once, and that no more than roughly `bulk_size` Model objects reside in memory at any given time.

When using `bulk_create` for relatively big sets of objects provided by a generator object, it would be prefered to avoid iterating over the entire generator object. Moreover, if not iterating over the generator object is deemed unnecessary or out-of-scope for django it would be prefered to make a comment on said behavior in documentation.

I suggest two possible solutions:
1. Document this behavior (`bulk_create` converts passed `objs` iterator to a list), or
2. Avoid doing so when `bulk_size` is given (or default is other than `None`. i.e. sqlite).

I did not research the possibility of avoiding the list conversion, but if that solution is accepted by the community I volunteer to investigate further and claim this ticket."	Cleanup/optimization	new	Database layer (models, ORM)	1.11	Normal				Unreviewed	0	0	0	0	0	0
