Bug 17009 - Duplicating frameworks is unnecessary slow
Summary: Duplicating frameworks is unnecessary slow
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 16955
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-01 12:46 UTC by Jonathan Druart
Modified: 2017-12-07 22:16 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 17009: Speed up the framework duplication (3.38 KB, patch)
2016-08-01 12:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17009: Speed up the framework duplication (3.17 KB, patch)
2016-08-02 08:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17009: Speed up the framework duplication (3.21 KB, patch)
2016-08-07 20:03 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 17009: Speed up the framework duplication (3.27 KB, patch)
2016-08-12 19:01 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2016-08-01 12:46:24 UTC
To duplicate frameworks, the code retrieve all the subfields, then execute 1 insert per subfield.
It's unnecessary slow, we can use the DBMS to do it.
Comment 1 Jonathan Druart 2016-08-01 12:48:31 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2016-08-02 08:49:45 UTC Comment hidden (obsolete)
Comment 3 Irma Birchall 2016-08-06 22:19:02 UTC
(In reply to Jonathan Druart from comment #2)
> Created attachment 53875 [details] [review] [review]
> Bug 17009: Speed up the framework duplication
> 
> To duplicate frameworks, the code retrieve all the subfields, then
> execute 1 insert per subfield.
> It's unnecessary slow, we can use the DBMS to do it.
> 
> Test plan:
> Create a new framework and duplicate the structure of another framework.

I applied the dependency 16995 then tried to apply this patch, it did not apply. 

Message: 
Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 16995 - Remove event attributes from two include files
tester@debian:~/kohaclone$ git bz apply 17009
Bug 17009 - Duplicating frameworks is unnecessary slow

53875 - Bug 17009: Speed up the framework duplication

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 17009: Speed up the framework duplication
fatal: sha1 information is lacking or useless (admin/marctagstructure.pl).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Bug 17009: Speed up the framework duplication
The copy of the patch that failed is found in:
   /home/tester/kohaclone/.git/rebase-apply/patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-17009-Speed-up-the-framework-duplication-FRLPWa.patch
Comment 4 Marc Véron 2016-08-07 20:03:03 UTC Comment hidden (obsolete)
Comment 5 Nick Clemens 2016-08-12 19:01:39 UTC
Created attachment 54398 [details] [review]
Bug 17009: Speed up the framework duplication

To duplicate frameworks, the code retrieve all the subfields, then
execute 1 insert per subfield.
It's unnecessary slow, we can use the DBMS to do it.

Test plan:
Create a new framework and duplicate the structure of another framework.

Signed-off-by: Marc <veron@veron.ch>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Kyle M Hall 2016-08-18 16:02:44 UTC
Pushed to master for 16.11, thanks Jonathan!
Comment 7 Frédéric Demians 2016-08-23 10:39:59 UTC
Pushed in 16.05. Will be in 16.05.03.
Comment 8 Julian Maurice 2016-08-24 10:44:53 UTC
Pushed to 3.22.x, will be in 3.22.10