Edgewall Software

Ticket #6127 (closed enhancement: duplicate)

Opened 14 months ago

Last modified 9 months ago

Report/Query Pagination Patch

Reported by: Naoki Takezoe Owned by: mgood
Priority: high Milestone:
Component: report system Version: 0.10.4
Severity: normal Keywords: query paginate
Cc: trac-ja@…

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

report.zip (3.1 KB) - added by Naoki Takezoe 14 months ago.
Trac-0.11b1_reportpaginate_r412.patch (34.2 KB) - added by trac-ja@… 9 months ago.
Patch againsts Trac-0.11b1

Change History

Changed 14 months ago by Naoki Takezoe

  Changed 14 months ago by sid

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?

  Changed 14 months ago by Naoki Takezoe

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?

in reply to: ↑ 3   Changed 14 months ago by nkantrowitz

  • status changed from new to closed
  • resolution set to duplicate

Old release branches are frozen, we only fix bugs, no new features.

  Changed 14 months ago by sid

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.

  Changed 14 months ago by Naoki Takezoe

Thanks. I'll try to port my patch to trunk.

Changed 9 months ago by trac-ja@…

Patch againsts Trac-0.11b1

follow-up: ↓ 8   Changed 9 months ago by trac-ja@…

  • cc trac-ja@… added
  • status changed from closed to reopened
  • resolution duplicate deleted

I port Takezoe's patch to 0.11b1.

  • SQL-level limitation in report and query module.
  • Uses Paginator class partially. (search module has a few diff, too.)
  • Fixes bugs in sortable columns and grouping.

Review it, please.

in reply to: ↑ 7 ; follow-up: ↓ 10   Changed 9 months ago by cboos

  • keywords query paginate added
  • priority changed from normal to high
  • milestone set to 0.12

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 report and query module.

Ok, that's the bulk of the issue. Did you test the SQL changes for SQLite, PostgreSQL (eventually MySQL)?

* Uses Paginator class partially. (search module 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.

  Changed 9 months ago by cboos

  • status changed from reopened to closed
  • resolution set to duplicate
  • milestone 0.12 deleted

Oh, and sure you'll hate me, but let's consolidate the discussion about report and query paging support on #216, of course ;-)

in reply to: ↑ 8   Changed 9 months ago by anonymous

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.

Add/Change #6127 (Report/Query Pagination Patch)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from mgood. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.