#6127 closed enhancement (duplicate)
Report/Query Pagination Patch
| Reported by: | Naoki Takezoe | Owned by: | Matthew Good | 
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | report system | Version: | 0.10.4 | 
| Severity: | normal | Keywords: | query paginate | 
| Cc: | trac-ja@… | Branch: | |
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
I'm using Trac in the big project which has a lot of tickets. Trac report displays all tickets at once, so it causes performance problem.
My attached patch (for Trac 0.10.4) contains the following features:
- report pagination (using SQL "LIMIT x OFFSET y". I think it's best solution for performance)
 - custom query pagination and max displaying limitation
 
And pagination/limitation parameters configured in trac.ini.
Attachments (2)
Change History (11)
by , 18 years ago
| Attachment: | report.zip added | 
|---|
comment:1 by , 18 years ago
comment:2 by , 18 years ago
PaginatePlugin fetches all ticket data, so it can't solve the performance problem.
#216 milestone is 1.0, but my patch works for 0.10.4 and it also contains custom query improvements. Should I attach to #216?
comment:4 by , 18 years ago
| Resolution: | → duplicate | 
|---|---|
| Status: | new → closed | 
Old release branches are frozen, we only fix bugs, no new features.
comment:5 by , 18 years ago
Naoki, yes, I'd recommend attaching your patch to #216. It would also help if the same patch worked with trunk to help its chances of getting merged into the codebase.
by , 18 years ago
| Attachment: | Trac-0.11b1_reportpaginate_r412.patch added | 
|---|
Patch againsts Trac-0.11b1
follow-up: 8 comment:7 by , 18 years ago
| Cc: | added | 
|---|---|
| Resolution: | duplicate | 
| Status: | closed → reopened | 
I port Takezoe's patch to 0.11b1.
- SQL-level limitation in 
reportandquerymodule. - Uses 
Paginatorclass partially. (searchmodule has a few diff, too.) - Fixes bugs in sortable columns and grouping.
 
Review it, please.
follow-up: 10 comment:8 by , 18 years ago
| Keywords: | query paginate added | 
|---|---|
| Milestone: | → 0.12 | 
| Priority: | normal → high | 
Hello, thanks for tackling this issue. Just a quick general note about our stylistic guide: you should really take care of following PEP:0008, in particular the length of the lines which should be kept under 80 characters (see also TracDev/CodingStyle).
Here are a few initial comments:
Replying to trac-ja@i-act.co.jp:
I port Takezoe's patch to 0.11b1.
- SQL-level limitation in
 reportandquerymodule.
Ok, that's the bulk of the issue. Did you test the SQL changes for SQLite, PostgreSQL (eventually MySQL)?
- Uses
 Paginatorclass partially. (searchmodule has a few diff, too.)
The trac/templates/presentation.html should rather be simply used as an include i.e. without the py:def. See #6374.
- Fixes bugs in sortable columns and grouping.
 
Would it be possible to get a separate patch for that? I saw the changes in the unit test, but it wasn't clear what was the bug and the fix.
comment:9 by , 18 years ago
| Milestone: | 0.12 | 
|---|---|
| Resolution: | → duplicate | 
| Status: | reopened → closed | 
Oh, and sure you'll hate me, but let's consolidate the discussion about report and query paging support on #216, of course ;-)
comment:10 by , 18 years ago
Thank you cboos for your review. I'll read PEP:0008, TracDev/CodingStyle and #6374.
Replying to cboos:
Replying to trac-ja@i-act.co.jp:
- Fixes bugs in sortable columns and grouping.
 Would it be possible to get a separate patch for that? I saw the changes in the unit test, but it wasn't clear what was the bug and the fix.
When sortable column clicked, sort is done limited subset.
This bug is not contain original code, but it exists Takezoe's patch.
And there are no relations between bug fixes and changes in unit test. When I patch query.py (maybe L329-L330), Href returns url query parameters with other order.
We continue to discuss other points in #216. Thank you.



  
See #216 and also http://www.trac-hacks.org/wiki/PaginateTicketsPlugin. Propose to close this as a duplicate. Maybe you can attach your page to #216?