﻿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
14131	The pagination module should have some limit, or a warning should be given in the documentation	Mike Lissner	Daniel Jilg	"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)."	Cleanup/optimization	closed	Documentation	dev	Normal	fixed		winsmith@…	Accepted	1	0	0	0	0	0
