Commit 30b5612
[sqlite] use checkpointing instead of vacuum
Summary:
`VACUUM` is used to shrink the size of DBs destined for caching (eg in buck), as well as to "canonicalise" their content into something deterministic.
VACUUM does two things:
1. it incorporates the WAL log into the main DB file.
2. it compacts the DB by combining half-empty pages and generally moving things around.
(2) is quite costly. In addition, it doesn't achieve byte-determinism (for instance, `VACUUM` is not idempotent wrt `md5sum`).
This diff replaces `VACUUM` with `PRAGMA wal_checkpoint` which only aims at doing (1). This saves considerable time on large DBs.
Reviewed By: skcho
Differential Revision: D32758493
fbshipit-source-id: a3688b13d51 parent 7e2d161 commit 30b5612
1 file changed
+8
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
| 173 | + | |
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
| |||
242 | 243 | | |
243 | 244 | | |
244 | 245 | | |
| 246 | + | |
245 | 247 | | |
246 | 248 | | |
247 | 249 | | |
| |||
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
265 | | - | |
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
| 271 | + | |
| 272 | + | |
270 | 273 | | |
271 | 274 | | |
272 | 275 | | |
| |||
285 | 288 | | |
286 | 289 | | |
287 | 290 | | |
288 | | - | |
289 | | - | |
290 | 291 | | |
291 | 292 | | |
292 | 293 | | |
293 | 294 | | |
294 | 295 | | |
295 | 296 | | |
296 | 297 | | |
| 298 | + | |
| 299 | + | |
297 | 300 | | |
298 | 301 | | |
299 | 302 | | |
| |||
314 | 317 | | |
315 | 318 | | |
316 | 319 | | |
317 | | - | |
318 | | - | |
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
| |||
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
445 | | - | |
| 446 | + | |
446 | 447 | | |
447 | 448 | | |
448 | 449 | | |
| |||
0 commit comments