emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sqlite3


From: Teemu Likonen
Subject: Re: sqlite3
Date: Tue, 07 Dec 2021 08:40:23 +0200
User-agent: Notmuch/0.34.1+9~gd7f9572 (https://notmuchmail.org) Emacs/28.0.60 (x86_64-pc-linux-gnu)

* 2021-12-06 02:51:33+0100, Lars Ingebrigtsen wrote:

> I.e., what Emacs needs is a persistent key/value store, and this would
> give us that.

> In addition, if somebody really wants to write SQL stuff (it can be
> very handy for some things), having sqlite3 in there gives us that in
> addition for free.

Excellent! Real SQL and relational database is useful and needed in some
situations but a simple Lispy key-value storage is nice and enough for
most use-cases.

> This comes with questions about how the users are supposed be able to
> clear out the data, for instance, but we could have a `M-x
> list-persistent-data' where the users could blow out whatever they
> want to.

From SQLite's point of view, by default, it only grows database files.
Deleted data in tables are just marked free and the space is filled
later by a new data.

I think Emacs users would want automatic VACUUM so that they never need
to worry about it. (1) One option for that is to set SQLite's

    PRAGMA auto_vacuum = FULL;

before any tables are created in database. (2) Another options is to
maintain a modify counter in the database and issue SQL's VACUUM when
the number of modifications exceeds some limit. It's actually good idea
to run vacuum from time to time anyway, even if "auto_vacuum = FULL". It
fixes possible defragmentation of database.

See: https://sqlite.org/pragma.html#pragma_auto_vacuum

-- 
/// Teemu Likonen - .-.. https://www.iki.fi/tlikonen/
// OpenPGP: 6965F03973F0D4CA22B9410F0F2CAE0E07608462

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]