Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-29 21:26:10 +01:00

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,12 +448,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)