Django is a generic framework. Those who use it to implement functionality
are the ones who kill either the browser or their entire application.
Applications must be written to meet functional and performance
requirements of the project. When dealing with large tables, more effort is
certainly needed when using the Admin. E.g. write custom ModelAdmins or
admin filters that restrict the resultset size.

I don't think Django should automatically limit these queries.

Regards,
Michael Manfre

On Tue, Nov 18, 2014 at 7:58 AM, Rick van Hattem <wolp...@gmail.com> wrote:

> Hi guys,
>
> As it is right now Django has the tendency to kill either your browser (if
> you're lucky) or the entire application server when confronted with a large
> database. For example, the admin always does counts for pagination and a
> count over a table with many rows (say, in the order of 100M) can really
> stall your app and database servers.
>
> In the past I've simply patched Django to include a few "security"
> features for cases like these so someone can't accidently kill the site by
> doing something silly, but I was wondering if it would be a good idea to
> include some of these configurable options in the core.
>
> Examples:
>  - If COUNT_LIMIT is set than wrap counts in a subquery and limit the
> results: SELECT COUNT(*) FROM (SELECT pk FROM table LIMIT <COUNT_LIMIT>)
>  - When someone does "if queryset" automatically limit it to a default
> slice size so someone doesn't accidently fetch all rows in the queryset.
>
> ~wolph
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/9ec3e5e6-0681-4e5b-bb8e-c450ce38c96a%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/9ec3e5e6-0681-4e5b-bb8e-c450ce38c96a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAGdCwBsxws8_MbzWOgAweC1XTShqU0Ckidbu_PUh1e0B7UZ04Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to