-
Notifications
You must be signed in to change notification settings - Fork 63
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
Retrieving template processes is inefficient for a large number of template processes #6267
Comments
Did you use an catalogue or not? If I try to create a new process I got first the catalogue dialog and later I can use the process templates to create a new process based on the selected process template. So far as I know there should only processes are shown which are used as a process template. This process template processes are serial / periodical issues which should not so many times existing in a Kitodo.Production instance (@andre-hohmann correct me if I'm wrong). But your catch is still true but the solution should be discussed. |
@henning-gerhardt I have only set up one "process template" for each project. If I set up two process templates, there is a selection dialog before the "Create new process" page is loaded. However, the selection has no impact on performance. I guess the problem is that - a few years ago - I have a auto-generated 1000s of processes with the property "inChoiceListShown" set to true, such that this particular dialog now contains a huge list. If this is not a problem in live production systems, I will manually edit my test database to fix the problem for me. Thank you for your feedback! |
You got trapped. There are two "process templates": one as you well known process template of the projects and the other over the "inChoiceListShown" which is displayed in the process create dialog as "process template" chooser - even in your own screenshot below the selected / shown ruleset choice. The shown list of processes in your screenshot are the processes which have the "inChoiceListShown" property set to true in the database / index and they are called "process templates" too but the based on already existing processes and not on the "process template" of a project. There is a better naming at least in English (or maybe even in German) needed here to show the differences. |
Okay. I'll keep the issue open for a few days, in case somebody else had a similar problem or thinks we need to implement some changes. If nobody else comments, I will close the issue in a few days. |
I think @henning-gerhardt is mostly correct, just one small remark: to avoid confusion - even though it's obviously only partly successful, based on Henning's description! - the "Templates", which have their own database table, are called "Templates" or "Process templates", while the processes with the specific flag
Nonetheless I support @thomaslow's suggestion to refactor the retrieval of "Template processes". Even if having so many "template processes" in the system is unlikely, if the current query can be improved, that is exactly what we should do. |
When clicking the "+" button of a project in order to create or import a new process, the page loads forever (>30 seconds).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The "Create new process" page should appear without any delay.
Release
Master
What is happening
I traced the problem to the "Process template" dialog that contains a list of all processes:
With my test database that contains ~80.000 process, this dialog tries to load all processes and its related entities, see:
kitodo-production/Kitodo/src/main/java/org/kitodo/production/forms/createprocess/SearchDialog.java
Lines 65 to 72 in 4d6138a
kitodo-production/Kitodo/src/main/java/org/kitodo/production/services/data/ProcessService.java
Lines 2845 to 2855 in 4d6138a
There are multiple problems:
By limiting the ElasticSearch query to return at most 100 processes, the "Create new process" page loads fine without any noticeable delay.
Suggested Changes
My suggestion would be to replace this drop down list with a simple search dialog or by asking the user to provide the process id without listing all processes.
The text was updated successfully, but these errors were encountered: