mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-11-22 00:59:07 -05:00
docs: update DB maintenance for v0.8.x
This commit is contained in:
parent
1ca5d652de
commit
bc4b45d4b8
|
@ -7,7 +7,7 @@ intervention. For heavily trafficked relays, there are a number of
|
||||||
steps that the operator may need to take to maintain performance and
|
steps that the operator may need to take to maintain performance and
|
||||||
limit disk usage.
|
limit disk usage.
|
||||||
|
|
||||||
This maintenance guide is current as of version `0.7.14`. Future
|
This maintenance guide is current as of version `0.8.2`. Future
|
||||||
versions may incorporate and automate some of these steps.
|
versions may incorporate and automate some of these steps.
|
||||||
|
|
||||||
## Backing Up the Database
|
## Backing Up the Database
|
||||||
|
@ -43,18 +43,15 @@ vacuum;
|
||||||
|
|
||||||
## Clearing Hidden Events
|
## Clearing Hidden Events
|
||||||
|
|
||||||
When events are deleted, either through deletion events, metadata or
|
When events are deleted, the event is not actually removed from the
|
||||||
follower updates, or a replaceable event kind, the event is not
|
database. Instead, a flag `HIDDEN` is set to true for the event,
|
||||||
actually removed from the database. Instead, a flag `HIDDEN` is set
|
which excludes it from search results. High volume replacements from
|
||||||
to true for the event, which excludes it from search results. The
|
profile or other replaceable events are deleted, not hidden, in the
|
||||||
original intent was to ensure that subsequent rebroadcasts of the
|
current version of the relay.
|
||||||
event would be easily detected as having been deleted, and would not
|
|
||||||
need to be stored again. In practice, this decision causes excessive
|
|
||||||
growth of the `tags` table, since all the previous followers are
|
|
||||||
retained for those `HIDDEN` events.
|
|
||||||
|
|
||||||
The `event` and especially the `tag` table can be significantly
|
In the current version, removing hidden events should not result in
|
||||||
reduced in size by running these commands:
|
significant space savings, but it can still be used if there is no
|
||||||
|
desire to hold on to events that can never be re-broadcast.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
PRAGMA foreign_keys = ON;
|
PRAGMA foreign_keys = ON;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user