Skip to content

Commit

Permalink
Revert "Speed up loading the dashboard on mysql/mariadb (go-gitea#28546
Browse files Browse the repository at this point in the history
…)" (go-gitea#29006) (go-gitea#29007)

Backport go-gitea#29006 by @lunny

This reverts commit fa8c3be. go-gitea#28546 
Because it seems performance become worse.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
GiteaBot and lunny committed Feb 1, 2024
1 parent c398c25 commit a0b9bd2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions models/activities/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,9 @@ func GetFeeds(ctx context.Context, opts GetFeedsOptions) (ActionList, int64, err
return nil, 0, err
}

sess := db.GetEngine(ctx).Where(cond)
if setting.Database.Type.IsMySQL() {
sess = sess.IndexHint("USE", "JOIN", "IDX_action_c_u_d")
}
sess = sess.Select("`action`.*"). // this line will avoid select other joined table's columns
Join("INNER", "repository", "`repository`.id = `action`.repo_id")
sess := db.GetEngine(ctx).Where(cond).
Select("`action`.*"). // this line will avoid select other joined table's columns
Join("INNER", "repository", "`repository`.id = `action`.repo_id")

opts.SetDefaultValues()
sess = db.SetSessionPagination(sess, &opts)
Expand Down

0 comments on commit a0b9bd2

Please sign in to comment.