Load local timeline a lot faster by using leftJoin instead of innerJoin, wow

This commit is contained in:
Alex Gleason 2023-12-29 21:05:31 -06:00
parent 9492b7654f
commit b39902d322
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 2 additions and 1 deletions

View File

@ -156,7 +156,8 @@ function getFilterQuery(filter: DittoFilter): EventQuery {
if (typeof filter.local === 'boolean') {
query = filter.local
? query.innerJoin(usersQuery, (join) => join.onRef('users.d_tag', '=', 'events.pubkey'))
? query.leftJoin(usersQuery, (join) => join.onRef('users.d_tag', '=', 'events.pubkey'))
.where('users.d_tag', 'is not', null)
: query.leftJoin(usersQuery, (join) => join.onRef('users.d_tag', '=', 'events.pubkey'))
.where('users.d_tag', 'is', null);
}