Patch #29406

Use sorted instead of sort

Added by Pavel Rosický about 1 year ago. Updated 9 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Performance
Target version:4.0.0

Description

using an order statement should be more effective because records are sorted in the database.

issue priorities on the issue's report page were originaly sorted by id (desc), but I think they should be sorted by position.

projects_versions.patch Magnifier (1.22 KB) Pavel Rosický, 2018-08-18 14:35

files_controller.rb.patch Magnifier (323 Bytes) Pavel Rosický, 2018-08-18 14:35

reports_controller.rb.patch Magnifier (886 Bytes) Pavel Rosický, 2018-08-18 14:54

reports_controller.rb.patch Magnifier (1.99 KB) Pavel Rosický, 2018-08-18 15:08

reports_controller.rb.patch Magnifier (1.86 KB) Pavel Rosický, 2018-12-01 18:12

fix-29406.diff Magnifier - combined Pavel Rosický's three patches (3.5 KB) Go MAEDA, 2018-12-02 02:17

Associated revisions

Revision 17685
Added by Go MAEDA 9 months ago

Use sorted instead of sort (#29406).

Patch by Pavel Rosický.

History

#2 Updated by Go MAEDA 9 months ago

  • Target version set to Candidate for next major release

Pavel Rosický wrote:

issue priorities on the issue's report page were originaly sorted by id (desc), but I think they should be sorted by position.

I prefer the current sort order. Showing the highest priority first is reasonable.

#3 Updated by Pavel Rosický 9 months ago

issue priorities on the issue's report page were originaly sorted by id

forget about this statement. I was wrong, enumerations have a default scope, so it's already sorted and I changed the order. I reverted this change and attached a fixed version of reports_controller_patch.rb

see also related #25867 for differences between sort vs sorted, it doesn't behave the same way

#4 Updated by Go MAEDA 9 months ago

  • File fix-29406.diffMagnifier added
  • Category changed from Code cleanup/refactoring to Performance
  • Target version changed from Candidate for next major release to 4.1.0

Passed all tests. Setting the target version to 4.1.0.

The attached patch is a combination of Pavel Rosický's three patches.

#5 Updated by Go MAEDA 9 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version changed from 4.1.0 to 4.0.0

Committed. Thank you for improving Redmine.

#6 Updated by Go MAEDA 9 months ago

  • Subject changed from use sorted instead of sort to Use sorted instead of sort

Also available in: Atom PDF