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

Clarification on the 'Optimizing SQLite for servers' article #101

Open
Qqwy opened this issue Nov 3, 2024 · 0 comments
Open

Clarification on the 'Optimizing SQLite for servers' article #101

Qqwy opened this issue Nov 3, 2024 · 0 comments

Comments

@Qqwy
Copy link

Qqwy commented Nov 3, 2024

Hey there @sylvain101010! Thank you for your great blog articles!

I have a brief question/errata about the 'Optimizing SQLite for servers' article. specifically about the 'cache_size' option.

You set it to the positive number 1000000000 i.e. 10⁹, and mention in the code comments further on that this should make the cache size one GB big.

However, in the SQLite docs, the cache_size pragma is described as:

PRAGMA schema.cache_size = pages;
PRAGMA schema.cache_size = -kibibytes;

i.e. when you specify a negative number, it will be counted in KiB and when you specify a positive number, it will be counted in pages (multiplied by the current page_size; by default for modern SQLite that is 4096 i.e. 4KiB). So I think that your set cache size will result in a desired cache size of 4096GB rather than 1GB.

Or did I miss something in the docs maybe?

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

1 participant