Skip to content

Commit c4a161d

Browse files
committed
set pragma secure_delete by default
1 parent 8515bfb commit c4a161d

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

docs/guide_db.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,4 @@ The [Zstandard](https://facebook.github.io/zstd/)-based [compression layer](http
249249

250250
The aforementioned zstd_level, threads, and page_size options all affect the compression time-space tradeoff, while enlarging the page cache can reduce decompression overhead (workload-dependent).
251251

252-
If you plan to delete or overwrite a significant amount of data in an existing database, issue [`PRAGMA secure_delete=ON`](https://www.sqlite.org/pragma.html#pragma_secure_delete) beforehand to keep the compressed file as small as possible. This works by causing SQLite to overwrite unused database pages with all zeroes, which the compression layer can then reduce to a negligible size.
253-
254252
With SQLite's row-major table [storage format](https://www.sqlite.org/fileformat.html), the first read of a lone cell usually entails decompressing at least its whole row, and there aren't any special column encodings for deltas, run lengths, etc. The "last mile" of optimization may therefore involve certain schema compromises, such as storing infrequently-accessed columns in a separate table to join when needed, or using application-layer encodings with [BLOB I/O](https://www.sqlite.org/c3ref/blob_open.html).

src/genomicsqlite.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ string GenomicSQLiteTuningSQL(const string &config_json, const string &schema =
280280
map<string, string> pragmas;
281281
pragmas[schema_prefix + "cache_size"] = to_string(-960 * cfg.GetInt("$.page_cache_MiB"));
282282
pragmas[schema_prefix + "max_page_count"] = "2147483646";
283+
pragmas[schema_prefix + "secure_delete"] = "ON"; // ensures empty space compresses to ~nothing
283284
if (schema_prefix.empty()) {
284285
int threads = cfg.GetInt("$.threads");
285286
pragmas["threads"] =

0 commit comments

Comments
 (0)