mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-13 23:37:34 -06:00
[performance] Update indexes that were causing slow db queries (#855)
* add status.url index, use id desc in some indexes * test account last posted
This commit is contained in:
parent
c4a08292ee
commit
429bb770e2
2 changed files with 94 additions and 0 deletions
|
|
@ -139,6 +139,12 @@ func (suite *AccountTestSuite) TestUpdateAccount() {
|
|||
suite.WithinDuration(time.Now(), noCache.UpdatedAt, 5*time.Second)
|
||||
}
|
||||
|
||||
func (suite *AccountTestSuite) TestGetAccountLastPosted() {
|
||||
lastPosted, err := suite.db.GetAccountLastPosted(context.Background(), suite.testAccounts["local_account_1"].ID)
|
||||
suite.NoError(err)
|
||||
suite.EqualValues(1653046675, lastPosted.Unix())
|
||||
}
|
||||
|
||||
func (suite *AccountTestSuite) TestInsertAccountWithDefaults() {
|
||||
key, err := rsa.GenerateKey(rand.Reader, 2048)
|
||||
suite.NoError(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue