Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile with SQLITE_ENABLE_DBSTAT_VTAB to enable DBSTAT table support? #1279

Closed
broofa opened this issue Feb 8, 2020 · 4 comments
Closed

Comments

@broofa
Copy link

broofa commented Feb 8, 2020

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.

@kewde
Copy link
Collaborator

kewde commented Feb 9, 2020

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

@broofa
Copy link
Author

broofa commented Feb 9, 2020

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

@broofa
Copy link
Author

broofa commented Feb 12, 2020

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?

@kewde
Copy link
Collaborator

kewde commented Apr 27, 2020

@broofa fixed in v4.2.0

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

No branches or pull requests

2 participants