Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: wp-cli/db-command
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: wp-cli/db-command
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix/db-size-columns
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Sep 15, 2026

  1. db size: Allow displaying data and index size separately

    The reported size has always been the sum of the data and the index
    size, which hides how much of a database is taken up by indexes alone.
    
    Add optional `Data` and `Index` fields that can be selected through the
    new `--fields` argument, while `Size` keeps reporting the total.
    
    For SQLite, the size of a table now covers its indexes as well, which
    matches how table sizes are reported for MySQL and MariaDB.
    
    Human readable sizes now default to two decimals, so that a database of
    6.23 GB is no longer reported as 7 GB, and a value that rounds up into
    the next size format is displayed in that size format.
    
    Fixes #348
    
    Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01WA7GLFtiJMyt4ZwaDq194v
    swissspidy and claude committed Sep 15, 2026
    Configuration menu
    Copy the full SHA
    88d2b18 View commit details
    Browse the repository at this point in the history
  2. db size: Accept megabytes in the human readable precision test

    The database of a WordPress installation is a few hundred kilobytes
    today, but the scenario should not start failing the day it grows past
    a megabyte.
    
    Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01WA7GLFtiJMyt4ZwaDq194v
    swissspidy and claude committed Sep 15, 2026
    Configuration menu
    Copy the full SHA
    5362d5a View commit details
    Browse the repository at this point in the history
  3. db size: Collect the SQLite sizes in a single pass over dbstat

    Every dbstat query walks all pages of the database file, so asking for
    the table size and the index size separately doubled that work for each
    table. One grouped query over dbstat joined to sqlite_master returns
    both, which also means the database-wide breakdown costs one query
    instead of two.
    
    The dbstat virtual table is not part of every SQLite build. Instead of
    letting a failed query pass a silent 0 B on to the output, fail with a
    message that names the missing extension.
    
    Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01WA7GLFtiJMyt4ZwaDq194v
    swissspidy and claude committed Sep 15, 2026
    Configuration menu
    Copy the full SHA
    bd815e3 View commit details
    Browse the repository at this point in the history
Loading