From a0b9bd2febdf2aca8f8d162da4f09c0a89b13033 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Thu, 1 Feb 2024 18:58:44 +0800 Subject: [PATCH] Revert "Speed up loading the dashboard on mysql/mariadb (#28546)" (#29006) (#29007) Backport #29006 by @lunny This reverts commit fa8c3beb26acfcc7e732038c947225857ebcbf31. #28546 Because it seems performance become worse. Co-authored-by: Lunny Xiao --- models/activities/action.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/models/activities/action.go b/models/activities/action.go index 3c66b6876..bf56f27a8 100644 --- a/models/activities/action.go +++ b/models/activities/action.go @@ -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)