Skip to content
This repository was archived by the owner on Jul 1, 2026. It is now read-only.
This repository was archived by the owner on Jul 1, 2026. It is now read-only.

Compile with SQLITE_ENABLE_DBSTAT_VTAB to enable DBSTAT table support? #1279

Closed

Description

@broofa

Per https://www.sqlite.org/dbstat.html , the DBSTAT table is only available if when sqlite is compiled with the SQLITE_ENABLE_DBSTAT_VTAB flag. Any reason not to do this?

Asking because the DBSTAT table is particularly helpful when analyzing db storage usage.

Activity

  1. kewde commented on Feb 9, 2020

    @kewde
    Collaborator

    Hi @broofa,

    Interesting question, I don't think this has come up before.
    I would assume enabling this would come with a minor performance impact, but I have not measured it or found anyone with an analysis. We would have to run a benchmark against a version with it enabled and one without it.

    Enabling DBSTAT is something that you can do yourself if you build from source.
    Add SQLITE_ENABLE_DBSTAT_VTAB=1 to the defines below:
    https://github.com/mapbox/node-sqlite3/blob/master/deps/sqlite3.gyp#L84
    https://github.com/mapbox/node-sqlite3/blob/master/deps/sqlite3.gyp#L97

    Clone this repository, make the changes above and then run
    npm install --build-from-source

  2. broofa commented on Feb 9, 2020

    @broofa
    Author

    Thanks for the quick reply. I'll try compiling with those flags and see how it goes..

  3. broofa commented on Feb 12, 2020

    @broofa
    Author

    Quick followup: After looking into this, we've decided that compiling our own version of this is not worth the complexity and time it adds to our build pipeline.

    @kewde While I don't know what perf impact this would have, the precompiled binariesand Homebrew both have this option enabled. That seems to suggest it's not a serious concern. So... enable it here for the sake of consistency?

  4. kewde commented on Apr 27, 2020

    @kewde
    Collaborator

    @broofa fixed in v4.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions