CI to automate build of zotero tarball for zotero aport https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/testing/zotero
Find a file
Dan Stillman 601358f24b Fix very slow purging of itemDataValues at startup in large databases
When an item is erased (removed from the trash or cleaned up from a
feed), we set a flag to purge values in `itemDataValues` on the next
startup, with this query:

DELETE FROM itemDataValues WHERE valueID NOT IN (SELECT valueID FROM itemData);

For some people, that query was incredibly slow and would result in
Zotero intermittently hanging on "Loading items…" for a long time at
startup. It's possible this is mostly limited to people who subscribe to
high-volume feeds and have a lot of item churn. One affected person had
>900K values in `itemDataValues` despite having only 20K items.

It turns out the slow query is due to the foreign-key constraint on
`itemData(valueID)` that references`itemDataValues(valueID)`. SQLite is
checking every row being deleted from `itemDataValues` against
`itemData`, even though the query is specifically removing rows that
don't exist in `itemData`! For the 900K-value DB, disabling foreign-key
checks causes the `DELETE` query to take 25 seconds instead of...some
much longer time that I didn't wait for.

We already had an `executeTransaction()` flag, `disableForeignKeys`, to
temporarily disable foreign-key checks, but it didn't do so in a way
that was safe for post-initialization usage -- a write query outside of
a transaction could've run between the transaction commit and
foreign-key checks being re-enabled. This commit changes it to properly
block all other queries unless they include an `ignoreDBLock` option,
meaning that queries within the function passed to the transaction need
to include that option. (And since that's not realistic for the couple
other uses of `disableForeignKeys` -- one for a test and one in code
that almost certainly hasn't been run by anyone in 15 years -- those now
just run `PRAGMA foreign_keys=OFF|ON` explicitly, leaving this as the
only current use.)
2025-03-12 23:25:32 -04:00
.github CI: Build ZIP for 7.0 branch 2025-02-21 01:37:43 -05:00
app Prevent DNS/TCP connections in snapshots 2025-03-12 23:25:32 -04:00
chrome Fix very slow purging of itemDataValues at startup in large databases 2025-03-12 23:25:32 -04:00
defaults/preferences Sort strings naturally or alphabetically (#5075) 2025-03-12 23:25:32 -04:00
js-build Fix localize-ftl crashing in certain cases #4773 (#4775) 2024-10-23 01:30:58 -04:00
note-editor@cd609cafd3 Update note-editor submodule 2025-02-19 02:03:23 -05:00
pdf-worker@f9857be700 Update pdf-worker submodule 2025-02-19 02:03:22 -05:00
reader@51fb33cb80 Update reader submodule 2025-03-12 18:26:21 +02:00
resource Update translators 2025-02-19 02:03:27 -05:00
scripts Add Gecko types and a script to update them (#4296) 2024-07-02 00:58:51 -04:00
scss Advanced Search: Remove red background from condition tooltips 2025-03-12 22:59:36 -04:00
styles@1554b78c31 Update styles 2024-12-03 16:11:24 -05:00
test Add tests for renderItemTitle() 2025-03-12 23:25:32 -04:00
translators@60a7cb79e9 Update translators 2025-02-19 02:03:27 -05:00
types/gecko Add Gecko types and a script to update them (#4296) 2024-07-02 00:58:51 -04:00
.babelrc Use production builds of react libraries (#4482) 2024-08-02 03:43:02 -04:00
.eslintignore Remove connectorTypeSchemaData.js from .eslintignore 2023-05-07 02:43:31 -04:00
.eslintrc CEify contextPane 2024-03-30 00:58:57 -04:00
.gitattributes Update Linux updater for Zotero 7 2023-05-20 10:51:47 +00:00
.gitignore Use user-provided codesign script for Windows signing 2024-04-08 10:12:58 +01:00
.gitmodules Move pdf-reader submodule to reader 2023-08-08 01:40:24 -04:00
chrome.manifest fx115: working autocomplete (#3789) 2024-03-30 00:58:57 -04:00
CONTRIBUTING.md Add "support questions" to CONTRIBUTING.md 2022-12-01 05:10:42 -05:00
COPYING Update COPYING 2018-03-26 11:27:48 +02:00
package-lock.json Fix localize-ftl crashing in certain cases #4773 (#4775) 2024-10-23 01:30:58 -04:00
package.json correct the value of the private field in package.json (#4870) 2024-11-28 00:00:58 -05:00
README.md "Zotero wiki" → "Zotero documentation" in app build README 2023-04-26 04:40:22 -04:00
update.rdf Update Fx minVersion to 45 2016-12-13 09:12:55 -05:00
version Update version 2025-02-21 01:37:48 -05:00

Zotero

CI

Zotero is a free, easy-to-use tool to help you collect, organize, cite, and share your research sources.

Please post feature requests or bug reports to the Zotero Forums. If you're having trouble with Zotero, see Getting Help.

For more information on how to use this source code, see the Zotero documentation.