use DISTINCT instead of GROUP BY
ci/woodpecker/push/lint-client Pipeline was successful Details
ci/woodpecker/push/lint-backend Pipeline was successful Details
ci/woodpecker/push/build Pipeline was successful Details
ci/woodpecker/push/lint-foundkey-js Pipeline was successful Details
ci/woodpecker/push/test Pipeline was successful Details

This should have better performance for large recordsets.

Ref: #198 (comment)
This commit is contained in:
Johann150 2022-10-11 20:15:59 +02:00
parent 421b42d07d
commit 0b8fa2665c
Signed by: Johann150
GPG Key ID: 9EE6577A2A06F8F1
1 changed files with 2 additions and 2 deletions

View File

@ -103,12 +103,12 @@ export default class DeliverManager {
// deliver to all of known network
const sharedInboxes = await Users.createQueryBuilder('users')
.select('users.sharedInbox', 'sharedInbox')
// so we don't have to make our inboxes Set work as hard
.distinct(true)
// can't deliver to unknown shared inbox
.where('users.sharedInbox IS NOT NULL')
// don't deliver to ourselves
.andWhere('users.host IS NOT NULL')
// so we don't have to make our inboxes Set work as hard
.groupBy('users.sharedInbox')
.getRawMany();
for (const inbox of sharedInboxes) {