On Apr 23, 1:43 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote:
> On Mon, Apr 23, 2012 at 3:58 AM, akaariai <akaar...@gmail.com> wrote:
> > The last one, qs.filter(id__in=large_list) is pretty much impossible to fix.
>
> what's wrong with:
>
> qs.filter((Q(id__in=large_list[:n])|Q(id__in=large_list[n:])))  ?
>
> >   1. Use different database. I guess you have a reason to use SQLite so this
> > might not be an option.
>
> Oracle has a 1000-element limit for the IN (....)  clause.  Of course,
> it does work with (IN(<1sthalf>) or IN(<2ndhalf>))

SQLite has the limit for the whole query, Oracle for just one IN
clause. For Oracle we already do that split. For SQLite we would need
to split the _whole query_ into two parts (that is, run
two .exectutes()) and then "join" the parts in Python. The joining in
Python is the hard part.

 - Anssi

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to