diff options
author | 2022-05-02 12:53:46 +0200 | |
---|---|---|
committer | 2022-05-02 11:53:46 +0100 | |
commit | a5852fd7e43bf97ea7def9de20cd6d02d954094d (patch) | |
tree | d72b7fe9bf603786a5533e6b566a8412b2b8f634 /internal/db/bundb/status.go | |
parent | Add logging to the new generic worker package (#516) (diff) | |
download | gotosocial-a5852fd7e43bf97ea7def9de20cd6d02d954094d.tar.xz |
[performance] Speed up some of the slower db queries (#523)
* remove unnecessary LOWER() db calls
* warn during slow db queries
* use bundb built-in exists function
* add db block test
* update account block query
* add domain block db test
* optimize domain block query
* fix implementing wrong test
* exclude most columns when checking block
* go fmt
* remote more unnecessary use of LOWER()
Diffstat (limited to 'internal/db/bundb/status.go')
-rw-r--r-- | internal/db/bundb/status.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/db/bundb/status.go b/internal/db/bundb/status.go index 1783723bb..4e670f59b 100644 --- a/internal/db/bundb/status.go +++ b/internal/db/bundb/status.go @@ -70,7 +70,7 @@ func (s *statusDB) GetStatusByID(ctx context.Context, id string) (*gtsmodel.Stat return s.cache.GetByID(id) }, func(status *gtsmodel.Status) error { - return s.newStatusQ(status).Where("LOWER(status.id) = LOWER(?)", id).Scan(ctx) + return s.newStatusQ(status).Where("status.id = ?", id).Scan(ctx) }, ) } @@ -82,7 +82,7 @@ func (s *statusDB) GetStatusByURI(ctx context.Context, uri string) (*gtsmodel.St return s.cache.GetByURI(uri) }, func(status *gtsmodel.Status) error { - return s.newStatusQ(status).Where("LOWER(status.uri) = LOWER(?)", uri).Scan(ctx) + return s.newStatusQ(status).Where("status.uri = ?", uri).Scan(ctx) }, ) } @@ -94,7 +94,7 @@ func (s *statusDB) GetStatusByURL(ctx context.Context, url string) (*gtsmodel.St return s.cache.GetByURL(url) }, func(status *gtsmodel.Status) error { - return s.newStatusQ(status).Where("LOWER(status.url) = LOWER(?)", url).Scan(ctx) + return s.newStatusQ(status).Where("status.url = ?", url).Scan(ctx) }, ) } |