mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-23 09:31:04 +00:00
Sort by id is faster
Since it's the primary key
This commit is contained in:
parent
0c83fd5994
commit
2385f891e5
1 changed files with 4 additions and 4 deletions
|
@ -26,7 +26,7 @@ class EntryRepository extends EntityRepository
|
|||
->leftJoin('e.user', 'u')
|
||||
->where('e.isArchived = false')
|
||||
->andWhere('u.id =:userId')->setParameter('userId', $userId)
|
||||
->orderBy('e.createdAt', 'desc')
|
||||
->orderBy('e.id', 'desc')
|
||||
->getQuery();
|
||||
|
||||
$paginator = new Paginator($qb);
|
||||
|
@ -52,7 +52,7 @@ class EntryRepository extends EntityRepository
|
|||
->leftJoin('e.user', 'u')
|
||||
->where('e.isArchived = true')
|
||||
->andWhere('u.id =:userId')->setParameter('userId', $userId)
|
||||
->orderBy('e.createdAt', 'desc')
|
||||
->orderBy('e.id', 'desc')
|
||||
->getQuery();
|
||||
|
||||
$paginator = new Paginator($qb);
|
||||
|
@ -78,7 +78,7 @@ class EntryRepository extends EntityRepository
|
|||
->leftJoin('e.user', 'u')
|
||||
->where('e.isStarred = true')
|
||||
->andWhere('u.id =:userId')->setParameter('userId', $userId)
|
||||
->orderBy('e.createdAt', 'desc')
|
||||
->orderBy('e.id', 'desc')
|
||||
->getQuery();
|
||||
|
||||
$paginator = new Paginator($qb);
|
||||
|
@ -111,7 +111,7 @@ class EntryRepository extends EntityRepository
|
|||
}
|
||||
|
||||
if ('created' === $sort) {
|
||||
$qb->orderBy('e.createdAt', $order);
|
||||
$qb->orderBy('e.id', $order);
|
||||
} elseif ('updated' === $sort) {
|
||||
$qb->orderBy('e.updatedAt', $order);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue