Menu

#682 Editing a resource with big author's list problem (slow)

Unknown
open
nobody
None
6.7.0
Improvement
8.0
MariaDB
Linux
Unknown
2024-05-19
2024-05-17
No

Hi to all!
We have a slow loading problem when editing a resource with 4 authors, in database we have 12.000 authors, so when the page is loading it generates 48.000 options and take more than minute to load the page.

Example: https://website.it/index.php?action=resource_RESOURCEFORM_CORE&type=edit&id=7671&list=1

What workaround we can do?
Maybe is a feature-request and it's possible to make a write-to-search select like in this post: https://stackoverflow.com/questions/54821596/select2-is-slow-on-opening-with-10-000-elements

Or it's possible to hide the select menu's or author's editing to let it see only for ADMIN account?

In the screenshot is an example. 4 authors, in total 12.000 options generated for every author.

Thank You in advance!
Vladislav

1 Attachments

Discussion

  • Stéphane Aulery

    Hi @vladislavp,

    We don't often come across a database with 12,000 authors. We have one and we are aware of the problem.

    See [#674] and [#457]. Indeed it would be necessary to build a selector which searches for the author.

    Regards,

     

    Related

    Bugs and feature requests : #457
    Bugs and feature requests : #674

  • Stéphane Aulery

    Hi @vladislavp,

    Something is odd in your screesnhot. There are no styles, all is black and white. Is it a choice or is there a configuration problem?

    Regards,

     
    • Mark Grimshaw

      Mark Grimshaw - 2024-05-18

      There is colour there Stéphane.

       
  • Mark Grimshaw

    Mark Grimshaw - 2024-05-18

    Hi Vladislav,

    Can I suggest the first thing is to update from 6.7.0 to 6.9.0 (assuming your environment can support the minimum MySQL/MariaDB and PHP versions)? We're always working on improving the efficiency of SQL etc. so perhaps the issue has been dealt with. If not, we will look into it and, as Stéphane notes, have bug reports open.

    And can I check, it is edting where this is a problem and not adding a resource? In the example you give, opening a resource with 4 authors. If so, it might be that each of the 4 times makes the same SQL call where it could be done just the once.

    If this is Ilisi, is Fabrizio Tallarita still there?

    Mark

     
    • Stéphane Aulery

      Hi,

      I tried to create and edit a resource with 4 author. It's not extremely slow thanks to the cache table. There is a bit of latency when opening a listview, it's not worse than that.

      What operating system and browser are you using @vladislavp?

      Regards,

       
      • Mark Grimshaw

        Mark Grimshaw - 2024-05-19

        We have a test database with over 12000 creators. I have just opened the edit form for a resource with 4 authors with the following execution results:
        PHP execution time: 0.62112 s
        SQL execution time: 0.09578 s
        TPL rendering time: 0.10902 s
        Total elapsed time: 0.82592 s
        Peak memory usage: 37.6329 MB
        Memory at close: 22.4528 MB
        Database queries: 69

        Opening the select box is a little sluggish (perhaps 0.5 seconds to display) as Stéphane notes. But I'm not experiencing anywhere near the +1 minute time you get to load the form.

        As Stéphane notes, we use a cache table where the list of formatted creators, ready for the select box, is stored. If that table row exists, it is used.

        I'm with Stéphane in thinking the error lies somewhere else and not in our code.

        (But we have been thinking of solutions such as you suggest; not so much for reasons of speed but for ease of use.)

        Mark

        EDIT: Have tested this large database on both mysql and mariadb servers.

         

        Last edit: Mark Grimshaw 2024-05-20

Log in to post a comment.