3 ms·
Would the SQLite vacuum function help with that?
by Multicomp 11mo ago
Would the SQLite vacuum function help with that?
- mceachen 11mo agoYou can VACUUM INTO, ~~but standard vacuum won’t rewrite the whole db~~ (vacuum rewrites the whole db) https://sqlite.org/lang_vacuum.html https://sqlite.org/lang_vacuum.html (Edit: if multiple processes are concurrently reading and writing, and one process vacuums, verify that the right things happen: specifically, that concurrent writes from other processes during a vacuum don’t get erased by the other processes’ vacuum. You may need an external advisory lock to avoid data loss).
- return_to_monke 11mo ago> You can VACUUM INTO, but standard vacuum won’t rewrite the whole db. This is not true. From the link you posted: > The VACUUM command works by copying the contents of the database into a temporary database file and then overwriting the original with the contents of the temporary file.
- mceachen 11mo agoUgh, you’re totally right. I always get optimize and vacuum mixed up. https://sqlite.org/pragma.html#pragma_optimize https://sqlite.org/pragma.html#pragma_optimize
- teddyh 11mo ago> You can VACUUM INTO, ~~but standard vacuum won’t rewrite the whole db~~ (vacuum rewrites the whole db) HN does not support whatever markup you are trying to use. You have to use Unicode: “You can VACUUM INTO, b̶u̶t̶ ̶s̶t̶a̶n̶d̶a̶r̶d̶ ̶v̶a̶c̶u̶u̶m̶ ̶w̶o̶n̶’̶t̶ ̶r̶e̶w̶r̶i̶t̶e̶ ̶t̶h̶e̶ ̶w̶h̶o̶l̶e̶ ̶d̶b̶ (vacuum rewrites the whole db)”