1
1
mirror of https://github.com/go-gitea/gitea synced 2024-06-15 15:55:47 +00:00

Revert "Speed up loading the dashboard on mysql/mariadb (#28546)" (#29006)

This reverts commit fa8c3beb26. #28546 
Because it seems performance become worse.
This commit is contained in:
Lunny Xiao 2024-02-01 14:25:37 +08:00 committed by GitHub
parent a1e0d8bd8b
commit 3a66762130
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -446,12 +446,9 @@ func GetFeeds(ctx context.Context, opts GetFeedsOptions) (ActionList, int64, err
return nil, 0, err return nil, 0, err
} }
sess := db.GetEngine(ctx).Where(cond) sess := db.GetEngine(ctx).Where(cond).
if setting.Database.Type.IsMySQL() { Select("`action`.*"). // this line will avoid select other joined table's columns
sess = sess.IndexHint("USE", "JOIN", "IDX_action_c_u_d") Join("INNER", "repository", "`repository`.id = `action`.repo_id")
}
sess = sess.Select("`action`.*"). // this line will avoid select other joined table's columns
Join("INNER", "repository", "`repository`.id = `action`.repo_id")
opts.SetDefaultValues() opts.SetDefaultValues()
sess = db.SetSessionPagination(sess, &opts) sess = db.SetSessionPagination(sess, &opts)