mongoengine icon indicating copy to clipboard operation
mongoengine copied to clipboard

Bad performance with django pagination in certain occasion

Open rogemita opened this issue 14 years ago • 4 comments

Hello, I'm having problems when using django generic view with pagination, and it's funny, but when you use pagination number for 12 objects, many requests are made to the database when the number of resulting elements is greater than 12 (more than one page), I got to investigate, note that made ​​17 queries to the database for these conditions. Thank you.

rogemita avatar May 22 '12 08:05 rogemita

Have you got any example code / test case for me to investigate?

rozza avatar May 22 '12 08:05 rozza

exactly paging by 12 elements, and the result is 14 elements in 2 pages, let me try to make an example to build a test to reproduce the problem

rogemita avatar May 22 '12 08:05 rogemita

The problem basically are in methods for class django.core.paginator, when calculated numbers of pages, and whether or not previous and next page, dont know what wrong with the number 12 in the query limit. The problem I could not reproduce on a test yet, when I achieved, I will keep you informed. thanks

rogemita avatar May 22 '12 18:05 rogemita

Closing for now - pending update

rozza avatar Aug 01 '12 12:08 rozza