Skip to content

Update sqlite optimize flags to match Firefox Desktop (backport #7485) - #7494

Merged
dsmithpadilla merged 2 commits into
release-v154from
mergify/bp/release-v154/pr-7485
Jul 24, 2026
Merged

Update sqlite optimize flags to match Firefox Desktop (backport #7485)#7494
dsmithpadilla merged 2 commits into
release-v154from
mergify/bp/release-v154/pr-7485

Conversation

@mergify

@mergify mergify Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

This PR aims to address cause 1 identified in bug https://bugzilla.mozilla.org/show_bug.cgi?id=2056115, alongside #7484 which addressed cause 2.

For the run_maintenance_optimize background task, we add the 0x10000 flag in addition to the default 0x12. This causes optimization of all tables even if they were never queried by the provided connection. This fixes a rare scenario where Firefox for Android can get stuck with incorrect table stats on the moz_origins table, leading to poor address bar autocomplete performance.

For the Drop implementation on PlacesDb, we add the now-default flag 0x10, which previously didn't exist, and was being explicitly overridden in the current implementation. This adds a row limit on analyze which can help to prevent poor shutdown performance, matching the change made in the fix for bug https://bugzilla.mozilla.org/show_bug.cgi?id=2017227.

I used Claude to assist with this investigation, and also this is my first contribution to a Mozilla project. So this change may warrant some scruitiny from those more experienced with the codebase. But to the best of my knowledge, it seems to be a positive change which helps in part to address the original issue I faced.

Thanks, Shawn

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
    • No tests added: this codepath wasn't tested before and I think is out of scope for us to test. It's an sqlite feature and should be tested in the sqlite codebase.
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
    • No changelog entry: Not a user-facing change and historically changes around this part of the code didn't get changelog entries.
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

This is an automatic backport of pull request #7485 done by [Mergify](https://mergify.com).

For the run_maintenance_optimize background task, we add the 0x10000 flag in addition to the default 0x12. This causes optimization of all tables even if they were never queried by the provided connection. This fixes a rare scenario where Firefox for Android can get stuck with incorrect table stats on the moz_origins table, leading to poor address bar autocomplete performance.

For the Drop implementation on PlacesDb, we add the now-default flag 0x10, which previously didn't exist, and was being explicitly overridden in the current implementation. This adds a row limit on analyze which can help to prevent poor shutdown performance, matching the change made in the fix for bug 2017227.

Co-authored-by: Mark Hammond <mhammond@skippinet.com.au>
(cherry picked from commit b5f89b3)
@mhammond
mhammond requested a review from a team July 24, 2026 00:12
@mhammond

Copy link
Copy Markdown
Member

The Android team requested this uplift.

@dsmithpadilla
dsmithpadilla merged commit db8856b into release-v154 Jul 24, 2026
13 checks passed
@dsmithpadilla
dsmithpadilla deleted the mergify/bp/release-v154/pr-7485 branch July 24, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants