Opened 7 years ago

Last modified 5 months ago

#27833 assigned Bug

prefetch_related fails with SQLite when used with 1000 parent records — at Version 1

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

Description (last modified by Tim Graham)

This is described in ticket:16937#comment:3, but I don't see any issue filed for it.

"[prefetch_related] will not work on some backends if you have a lot of objects in your queryset. For example the SQLite backend has a limitation of 999 parameters to single SQL query, so if you have 1000 objects, prefetch_related will fail as you need to supply 1000 id values to the query."'

Batch it up like in #16426 and #17788, which dealt with the same limitation?

Change History (1)

comment:1 by Tim Graham, 7 years ago

Description: modified (diff)
Triage Stage: UnreviewedAccepted
Note: See TracTickets for help on using tickets.
Back to Top