-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug/57305 sorting by custom field has strong impact on performance for the project list #16841
Bug/57305 sorting by custom field has strong impact on performance for the project list #16841
Conversation
f7fbb59
to
40034e9
Compare
33ea0df
to
29dac54
Compare
74aaecc
to
73daf9f
Compare
def summable_statement | ||
if %w[float int].include?(custom_field.field_format) | ||
select = summable_select_statement | ||
|
||
->(query, grouped) { | ||
Queries::WorkPackages::Selects::WorkPackageSelect | ||
.scoped_column_sum(summable_scope(query), select, grouped:, query:) | ||
} | ||
else | ||
"COALESCE(ROUND(SUM(value::NUMERIC), 2)::FLOAT, 0.0) #{name}" | ||
false | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diff may make it confusing, this is extracted from set_summable!
172eb20
to
3dcfa9c
Compare
89a556f
to
5bd80f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good functionality and also performance wise, in the tests I have conducted. It is now possible to group by way more fields which when looking at community is nice.
There are some issues with the added grouping options, though. Of those, the first is but a display issue. But the second one leads to entries being sorted into the wrong group.
Grouping by integer cf
Here, the grouping happens with an integer cf. The groups however are presented as floats.
Grouping by link cf
The backend correctly returns just one item in the group. The frontend still places more entries into the group.
5bd80f6
to
e4acf8c
Compare
@ulferts I wasn't able to reproduce the problem with grouping, we should look at it together |
e4acf8c
to
d103deb
Compare
c45ae94
to
804986d
Compare
Grouping by link is fixed by 804986d, the issue was already there, but it was not possible to group by link custom field. Similar problem exists for grouping by bool custom fields, as absence of value will lead to |
Previously it relied on receiving empty string
6f38bdc
to
690b342
Compare
… is set after turbo:load too
690b342
to
dc28e44
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Ticket
OP#57305 + OP#57554
What are you trying to accomplish?
Screenshots
What approach did you choose and why?
Merge checklist