Skip to content
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

exclude 'closed' versions or releases from droppables #11

Merged
merged 1 commit into from Aug 9, 2022

Conversation

fuminori-ido-m
Copy link
Collaborator

Issue

In lib/backlogs_project_patch.rb, ProjectPatch::InstanceMethods#_sql_for_droppables gather infos of [projects.id, versions/releases ids under the projects], which will be used to check a story can be dragged&dropped on the page.

When the number of versions and/or releases become large, two problems arise:

  • A) the SQL takes long time (e.g. 26 seconds under Versions.count ~= 900 and projects.count ~= 240 our case).
  • B) In MySQL, GROUP_CONCAT default max length is 1024 chars so that the _sql_for_droppables method easily exeeds at our case; the result is chopped so that incorrect value is returned.

Solution for A

I think the closed versions and releases should be excluded from droppables because they are not used at backlog page, am I right?

This PR is for A.

(Solution for B would tune MySQL server parameter or session(SET SESSION group_concat_max_len = ...))

@fuminori-ido-m
Copy link
Collaborator Author

I wrote:

I think the closed versions and releases should be excluded from droppables because they are not used at backlog page, am I right?

but I am not sure so that I'm asking the same question at the origin. Even though my understanding is right or not, taking long time at this droppable SQL has no meaning because drag&drop doesn't work at project-tree as I am asking.

@ghost
Copy link

ghost commented Aug 8, 2022

just wondering.

as time passes by, the number of closed tickets will increase but the number of open tickets expects to be pretty much the same if usage stays in the same way.

does this use an appropriate index available?
are there any more suitable indexes if we change the order of where condition?

drp.status <> 'closed'

@fuminori-ido-m
Copy link
Collaborator Author

Thank you for your pointing out about indexing! I didn't think about that.

...However, I have no idea how to tune around the index of this SQL even though I tried to explain it. That should be a task to resolve.

@fuminori-ido-m fuminori-ido-m merged commit b003b7e into master Aug 9, 2022
fuminori-ido-m pushed a commit that referenced this pull request Aug 9, 2022
@fuminori-ido-m fuminori-ido-m deleted the feature_63144 branch August 17, 2022 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant