Follow list chaos and destruction #1104
alexgleason
started this conversation in
General
Replies: 2 comments 12 replies
-
1 millisecond, right? 1 Millisecond for 300 rows sounds about right. |
Beta Was this translation helpful? Give feedback.
4 replies
-
I have come to realize that the tag key is irrelevant for the tag's database index. The value is what matters. Most of the time, if not all the time, we don't have the same value for separate keys. An |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am storing Nostr events in an SQLite database. Inserting a follow list can take more than 1 second due to indexing all the tags.
I created a benchmark to reproduce the behavior:
It is over 7x slower to insert an event with 300 tags vs 1 tag.
p
tags in follow lists, because I need the ability to check following relationships between any two users at any time.pragma synchronous = normal
, experimenting with different ways of using transactions and formatting the query. Nothing makes the performance acceptable. Maybe I will try creating a worker pool so slow queries don't block other queries, but having 1s queries is still bad.There is maybe some way of storing diffs so I don't have to insert so many tags for each event. This is related to #349 and #1036. I'm not sure the best way to handle this yet.
Beta Was this translation helpful? Give feedback.
All reactions