mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-26 03:23:32 -06:00
[performance] add account block DB cache and remove block query joins (#1085)
* add account block DB cache and remove reliance on relational joins * actually include cache key arguments... * add a PutBlock() method which also updates the block cache, update tests accordingly * use `PutBlock` instead of `Put(ctx, block)` * add + use functions for deleting + invalidating blocks Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
This commit is contained in:
parent
9be16852f2
commit
5d55e8d920
11 changed files with 319 additions and 80 deletions
|
|
@ -166,6 +166,7 @@ func NewBunDBService(ctx context.Context) (db.DB, error) {
|
|||
notif := ¬ificationDB{conn: conn}
|
||||
status := &statusDB{conn: conn}
|
||||
emoji := &emojiDB{conn: conn}
|
||||
relationship := &relationshipDB{conn: conn}
|
||||
timeline := &timelineDB{conn: conn}
|
||||
tombstone := &tombstoneDB{conn: conn}
|
||||
user := &userDB{conn: conn}
|
||||
|
|
@ -174,6 +175,7 @@ func NewBunDBService(ctx context.Context) (db.DB, error) {
|
|||
account.emojis = emoji
|
||||
account.status = status
|
||||
admin.users = user
|
||||
relationship.accounts = account
|
||||
status.accounts = account
|
||||
status.emojis = emoji
|
||||
status.mentions = mention
|
||||
|
|
@ -185,6 +187,7 @@ func NewBunDBService(ctx context.Context) (db.DB, error) {
|
|||
emoji.init()
|
||||
mention.init()
|
||||
notif.init()
|
||||
relationship.init()
|
||||
status.init()
|
||||
tombstone.init()
|
||||
user.init()
|
||||
|
|
@ -209,9 +212,7 @@ func NewBunDBService(ctx context.Context) (db.DB, error) {
|
|||
},
|
||||
Mention: mention,
|
||||
Notification: notif,
|
||||
Relationship: &relationshipDB{
|
||||
conn: conn,
|
||||
},
|
||||
Relationship: relationship,
|
||||
Session: &sessionDB{
|
||||
conn: conn,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue