mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-26 16:22:15 +01:00
Backport #29006 by @lunny This reverts commitfa8c3beb26
. #28546 Because it seems performance become worse. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> (cherry picked from commita0b9bd2feb
)
This commit is contained in:
parent
faafccbcc7
commit
af98a0a7c6
1 changed files with 3 additions and 6 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue