#14131: The pagination module should have some limit, or a warning should be 
given
in the documentation
--------------------------+-------------------------------------------------
 Reporter:  mlissner      |       Owner:  nobody    
   Status:  new           |   Milestone:            
Component:  Contrib apps  |     Version:  SVN       
 Keywords:                |       Stage:  Unreviewed
Has_patch:  0             |  
--------------------------+-------------------------------------------------
 Perhaps I'm off base on this, but I was just analyzing my slow queries
 log, and I noticed that the pagination module produces some incredibly
 slow queries in MySQL when high page numbers are requested. This just took
 down my server, so I was thinking about possible solutions.

 The pagination module is using the OFFSET MySQL clause, which, as I
 understand it, must iterate over every row up to the OFFSET number in
 order to work.

 The two solutions I thought of for this were:

 1. Add something to the documentation that indicates how this might
 produce very slow queries.

 2. Add code to the pagination module to either:


     1. Solve the problem with smarter MySQL queries (not sure if/how this
 is possible, sorry); or
     1. Allow a max_pages attribute, which throws some kind of error when
 the max_page number is exceeded. It could even have a sane default,
 keeping people within normal limits.

 Admittedly, 2b is the solution I'm coding up right now, but it would be
 nice if Django enforced, or at least hinted at, a solution to this
 problem.

 I've also (FWIW) tested pagination on Google, Yahoo, and Bing, and all
 three limit their results (Bing: page 20, Google: page 100, and Yahoo:
 page 100).

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14131>
Django <http://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 post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to