-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Labels
service/databaseItems related to the xmtpd databaseItems related to the xmtpd database
Description
Scanning a partition has plan fixed cost of 1ms, and in many the queries, such as SelectGatewayEnvelopesByTopics, the planner has to consider all partitions. Scales linearly and becomes unbearable, as the system reaches >~ 500 partitions easily.
This issue becomes a bottleneck specially in SelectGatewayEnvelopesByTopics - selecting by topic, as we can't predict the originator id where an specific topic will fall, so no partition pruning applies.
Which is aggravated by the fact libxmtp most used backend query is QueryEnvelopes by topic.
Consider strategies:
- materialized view
- application side cache
- prepared statements with plan_cache_mode
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
service/databaseItems related to the xmtpd databaseItems related to the xmtpd database
Type
Projects
Status
No status