Manually adding author is extremely slow and causes background activities to hang

Report ID: 1342449427

When I add an Author, whether to a record that has been imported or manually created, entering the name of an Author and pressing return causes Zotero to go away for a really long time, and the "+" icon to add another author remains greyed out. Furthermore, if anything else is done to the record (e.g., editing abstract, adding a date etc.) whatever was done since the Author addition was triggered is lost (i.e., it is as if there are two competing background edit activities).

Steps to reproduce:

1. Create or select a record

2. Enter text in the author field and press return

3. The author column remains unpopulated for a really long time, and the icon to add another author remains greyed out

  • Are any other operations slow or is your library very large (>50k total items)?
    This is instantaneous in my reasonably large library.
  • May be related to another error, a crash this time: 1928278386
  • Can you restart Zotero and provide a Debug ID (different from a Report ID) for an operation that's slow?
  • My library is large (144,775 items in My Library view) but adding/editing/searching everything else happens in tolerable time - it is the Author stuff that seems pathological.
  • Here is a DebugID: D37004740

    Actions:

    1. selected record

    2. added author

    3. waited for greyed out '+' icon to come back - observed that addition had failed

    4. added author again

    5. worked this time (after some time)
  • See also Debug ID D1540840062 after a bit more editing of the same record
  • It looks like the problem here is the database queries to provide creator autocomplete are taking a long time for you.

    Do you have any items with a very large number (hundreds or thousands) of creators?

    If you go to Tools → Developer → Run JavaScript and run the following command, what's the output?

    return await Zotero.DB.valueQueryAsync("SELECT COUNT(DISTINCT creatorID) FROM creators JOIN itemCreators USING (creatorID) JOIN items USING (itemID) WHERE libraryID=1") + " " + await Zotero.DB.valueQueryAsync("SELECT COUNT(*) FROM creators")

    Can you provide a Debug ID just for typing "Smith" in the Last field and waiting for the autocomplete results to appear, and then pressing Esc without saving anything? (It might take 30 or more seconds.)
  • Thanks for investigating.

    Yes, there are some items with large numbers of items (since some papers from consortia insist on including every member as an author).

    The query returns 280059.

    The DebugID for the action requested is D183924156, though the autocomplete on Last did not take very long before returning a list of suggestions (as distinct from finishing the entry and waiting for the "+" add another author icon to ungrey) - it seems to be to be the author insertion action that is taking a while, not the autocomplete suggestion list generation.

    David

    PS. I can live without autocomplete on the authors, if there is a way to turn it off.



  • The query returns 280059.
    Right, that's a lot.
    (3)(+0002869): Starting autocomplete search with data […] 'S'

    (4)(+0000001): SELECT * FROM […] ['S%', 0, 1960828, 1, 1]

    (3)(+0000174): Stopping autocomplete search

    (3)(+0000052): Starting autocomplete search with data […] 'Sm'

    (4)(+0000001): SELECT * FROM […] ['Sm%', 0, 1960828, 1, 1]

    (3)(+0000179): Stopping autocomplete search

    (3)(+0000055): Starting autocomplete search with data […] 'Smi'

    (4)(+0000000): SELECT * FROM […] ['Smi%', 0, 1960828, 1, 1]

    (3)(+0000098): Stopping autocomplete search

    (3)(+0000050): Starting autocomplete search with data […] 'Smit'

    (4)(+0000001): SELECT * FROM […] ['Smit%', 0, 1960828, 1, 1]

    (3)(+0000076): Stopping autocomplete search

    (3)(+0000054): Starting autocomplete search with data […] 'Smith'

    (4)(+0000000): SELECT * FROM […] ['Smith%', 0, 1960828, 1, 1]

    (3)(+0005923): Appending autocomplete value 'S' (240470-1)

    [more "s" results]

    (3)(+0000000): Autocomplete query completed

    (3)(+0000001): Found 50 results

    (3)(+0004213): Hiding editor for creator-0-lastName

    (4)(+0000005): Item 1960828 has not changed

    (3)(+0001780): Appending autocomplete value 'SMITH' (69130-1)

    [more "sm" results]

    (3)(+0000000): Autocomplete query completed

    (3)(+0000000): Found 100 results

    (3)(+0006108): Appending autocomplete value 'SMITH' (69130-1)

    [more "smi" results]

    (3)(+0000001): Autocomplete query completed

    (3)(+0000000): Found 150 results

    (3)(+0001027): Getting contents of /Users/[…]/Library/Application Support/Zotero/Profiles/z0prpzyg.default/treePrefs.json

    (3)(+0005150): Appending autocomplete value 'SMITH' (69130-1)

    [more "smit" results]

    (3)(+0000000): Autocomplete query completed

    (3)(+0000001): Found 200 results

    (3)(+0006282): Appending autocomplete value 'SMITH' (69130-1)

    [more "smith" results]

    (3)(+0000001): Autocomplete query completed

    (3)(+0000000): Found 250 results
    it seems to be to be the author insertion action that is taking a while, not the autocomplete suggestion list generation
    No, it's the autocomplete, or at least also the autocomplete. The results for each letter ("s", "sm", "smi", etc.) are taking 5–6 seconds.

    If you think it's slow after that, we'd want to see a Debug ID that shows you waiting to enter the author until only "smith" results have appeared, which, again, might take 30 or more seconds. You can just wait a minute after typing "smith" to be safe.
  • Done - see D1349046505

    Action was to add an author, wait the 15-20 seconds till "+" was re-enabled, and add two more authors in the same manner.
  • You don't seem to have done what I said, though? I said to type "Smith" and wait for autocomplete to finish completely — a full minute — and then and only then create the creator.
  • Oh, I misunderstood.

    Try D1842553952.
  • Right, so actually inserting the creator is instantaneous. It's just the autocomplete queries that are slow.

    We'll look into this.
Sign In or Register to comment.