Merge pull request 'Revert "Speed up loading the dashboard on mysql/mariadb (#28546)" (#29006) (#29007)' (#2279) from earl-warren/forgejo:wip-v1.21-performance into v1.21/forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2279
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-02-01 21:02:25 +00:00
commit 108c984945

View file

@ -448,11 +448,8 @@ 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
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()