/[Apache-SVN]
ViewVC logotype

Revision 1817042


Jump to revision: Previous Next
Author: kotkov
Date: Sun Dec 3 17:28:29 2017 UTC (6 years, 3 months ago)
Changed paths: 9
Log Message:
fsfs: Use the `WITHOUT ROWID` optimization for rep-cache.db in format 8.

This optimization, introduced in SQLite 3.8.2, works well for tables that
have non-integer primary keys, such as

    hash TEXT NOT NULL PRIMARY KEY

in the rep-cache.db.  (See the https://sqlite.org/withoutrowid.html article
for additional details.)

A quick experiment showed a reduction of the on-disk size of the database
by ~1.75x.  The lookups should also be faster, both due to the reduced
database size and due to the lesser amount of internal bsearches.  This
should improve the times of new commits and `svnadmin load`, especially
for large repositories that also have large rep-cache.db files.

In order to maintain compatibility, since SQLite versions prior to 3.8.2
do not support this statement, we only start using it for fsfs format 8
repositories and simultaneously bump the minimal required SQLite version
from 3.7.12 (May 2012) to 3.8.2 (December 2013).  The last step ensures that
all binaries compiled to support format 8 can work with the tables with
this optimization.  Also, as the various scripts have both the minimal
and recommended (3.7.15.1) SQLite versions, we bump the recommended
version to the last 3.8.x patch version, which is 3.8.11.1.

* subversion/libsvn_fs_fs/rep-cache-db.sql
  (STMT_CREATE_SCHEMA): Rename this ...
  (STMT_CREATE_SCHEMA_V1): ...to this.
  (STMT_CREATE_SCHEMA_V2): New, enables `WITHOUT ROWID` optimization.
  (STMT_GET_REP, STMT_SET_REP, STMT_GET_REPS_FOR_RANGE,
   STMT_GET_MAX_REV, STMT_DEL_REPS_YOUNGER_THAN_REV,
   STMT_LOCK_REP, STMT_UNLOCK_REP):
   Note that these statements work for both V1 and V2 schemas.

* subversion/libsvn_fs_fs/fs.h
  (SVN_FS_FS__MIN_REP_CACHE_SCHEMA_V2_FORMAT): New.

* subversion/libsvn_fs_fs/rep-cache.c
  (REP_CACHE_SCHEMA_FORMAT): Remove.
  (open_rep_cache): Select between creating a V1 or V2 schemas based
   on the format of the filesystem.

* subversion/libsvn_subr/sqlite.c
  (): Bump minimum required SQLite version to 3.8.2.

* subversion/tests/cmdline/svnadmin_tests.py
  (check_hotcopy_fsfs_fsx): Check if the Python's built-in SQLite version
   is enough to interpret the schema of rep-cache.db, and skip the check
   if it's not.

* build/generator/gen_win_dependencies.py
  (_find_sqlite): Bump minimum required SQLite version to 3.8.2.

* configure.ac
  (SQLITE_MINIMUM_VER): Bump to 3.8.2.
  (SQLITE_RECOMMENDED_VER): Bump to 3.8.11.1.
  (SQLITE_RECOMMENDED_VER_REL_YEAR): New, required to construct the
   download URL which includes the release year for the newer SQLite
   amalgamation versions.
  (SQLITE_URL): Update the download URL.

* get-deps.sh
  (SQLITE_VERSION): Bump to 3.8.11.1.
  (SQLITE_VERSION_REL_YEAR): New.
  (get_sqlite): Update the download URL that includes the release year
   for the newer SQLite amalgamation versions.

* INSTALL
  (C.12.SQLite): Bump minimum required SQLite version to 3.8.2.
  (E.1.Prerequisites): Bump the minimum and recommended SQLite versions.


Changed paths

Path Details
Directorysubversion/trunk/INSTALL modified , text changed
Directorysubversion/trunk/build/generator/gen_win_dependencies.py modified , text changed
Directorysubversion/trunk/configure.ac modified , text changed
Directorysubversion/trunk/get-deps.sh modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/fs.h modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/rep-cache-db.sql modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/rep-cache.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_subr/sqlite.c modified , text changed
Directorysubversion/trunk/subversion/tests/cmdline/svnadmin_tests.py modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26