mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Improve indices for action
table (#23532)
Close #21611 Add the index mentioned in https://github.com/go-gitea/gitea/issues/21611#issuecomment-1451113252 . Since we already have an index for `("created_unix", "user_id", "is_deleted")` columns on PostgreSQL, I removed the database type check to apply this index to all types of databases.
This commit is contained in:
parent
e52ea44edd
commit
b958dba1a0
3 changed files with 51 additions and 6 deletions
|
@ -98,12 +98,10 @@ func (a *Action) TableIndices() []*schemas.Index {
|
|||
actUserIndex := schemas.NewIndex("au_r_c_u_d", schemas.IndexType)
|
||||
actUserIndex.AddColumn("act_user_id", "repo_id", "created_unix", "user_id", "is_deleted")
|
||||
|
||||
indices := []*schemas.Index{actUserIndex, repoIndex}
|
||||
if setting.Database.Type.IsPostgreSQL() {
|
||||
cudIndex := schemas.NewIndex("c_u_d", schemas.IndexType)
|
||||
cudIndex.AddColumn("created_unix", "user_id", "is_deleted")
|
||||
indices = append(indices, cudIndex)
|
||||
}
|
||||
cudIndex := schemas.NewIndex("c_u_d", schemas.IndexType)
|
||||
cudIndex.AddColumn("created_unix", "user_id", "is_deleted")
|
||||
|
||||
indices := []*schemas.Index{actUserIndex, repoIndex, cudIndex}
|
||||
|
||||
return indices
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue