mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-29 14:19:48 -04:00
Try moving projection after sort/limit
Trying to get these queries to be faster
This commit is contained in:
parent
ab0ac4342b
commit
5b39c6bb19
1 changed files with 2 additions and 2 deletions
|
@ -160,9 +160,9 @@ module.exports.getTwoGames = (req, res) ->
|
|||
query = LevelSession
|
||||
.aggregate()
|
||||
.match(queryParams)
|
||||
.project(selection)
|
||||
.sort({'submitDate': -1})
|
||||
.limit(sortLimit)
|
||||
.project(selection)
|
||||
.skip(humanSkipCount)
|
||||
.limit(1)
|
||||
query.exec (err, randomSession) =>
|
||||
|
@ -175,9 +175,9 @@ module.exports.getTwoGames = (req, res) ->
|
|||
query = LevelSession
|
||||
.aggregate()
|
||||
.match(queryParams)
|
||||
.project(selection)
|
||||
.sort({'submitDate': -1})
|
||||
.limit(sortLimit)
|
||||
.project(selection)
|
||||
.skip(ogresSkipCount)
|
||||
.limit(1)
|
||||
query.exec (err, otherSession) =>
|
||||
|
|
Loading…
Add table
Reference in a new issue