Browse Source

Fix SQL statement with poor performance

master
hewenyang 7 years ago
parent
commit
1ca916581d
  1. 2
      modules/submission.js

2
modules/submission.js

@ -105,7 +105,7 @@ app.get('/submissions', async (req, res) => {
} }
let paginate = syzoj.utils.paginate(await JudgeState.count(where), req.query.page, syzoj.config.page.judge_state); let paginate = syzoj.utils.paginate(await JudgeState.count(where), req.query.page, syzoj.config.page.judge_state);
let judge_state = await JudgeState.query(paginate, where, [['submit_time', 'desc']]); let judge_state = await JudgeState.query(paginate, where, [['id', 'desc']]);
await judge_state.forEachAsync(async obj => obj.loadRelationships()); await judge_state.forEachAsync(async obj => obj.loadRelationships());

Loading…
Cancel
Save