Skip to content

Commit

Permalink
Revert "Speed up loading the dashboard on mysql/mariadb (#28546)" (#2…
Browse files Browse the repository at this point in the history
…9006)

This reverts commit fa8c3be. #28546 
Because it seems performance become worse.
  • Loading branch information
lunny authored Feb 1, 2024
1 parent a1e0d8b commit 3a66762
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 3a66762

Please sign in to comment.