Skip to content

Delete in the hot path of insert staged envelope slows down the write #1573

@fbac

Description

@fbac

The current publish worker loop is:

SELECT N envelopes
... process ...
INSERT as originator envelope
... check if it was inserted ...
DELETE staged envelope

This is likely creating delete bloat / vacuum pressure.

Can this process become more efficient? Ideas:

  • SKIP LOCKED + delete in same transaction
  • claim + mark processed_at, delete later in another sweeper/pruner process
  • append only, partition and drop old partitions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    service/databaseItems related to the xmtpd database

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions