Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-707

Compaction is ineffective (auto_vacuum not enabled)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.8.0
    • 2.7.0
    • LiteCore
    • Security Level: Public

    Description

      Today while investigating CBSE-7971 I discovered that our databases are not being created with SQLite incremental vacuum enabled, because of an undocumented ordering dependency of pragmas when setting up a new db.

      This means CBL's compact() method hasn't been doing much. The SQLite call to "pragma incremental_vacuum" is a no-op. Compaction does some index optimization, and deletes unused blobs, but that's it. Free space inside the DB file is not returned to the OS.

      For new databases we can correct the problem by reordering the SQLite commands that are run when a new db is initialized. Unfortunately there is no way to correct this for existing databases, because auto_vacuum can only be enabled on an empty database

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jens Jens Alfke
            jens Jens Alfke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty