mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
EventsDB: use a subquery instead of a join
This commit is contained in:
parent
8bed0c17be
commit
c3adafa860
1 changed files with 2 additions and 3 deletions
|
|
@ -200,9 +200,8 @@ class EventsDB implements NStore {
|
||||||
) as { key: 'domain'; value: string } | undefined)?.value;
|
) as { key: 'domain'; value: string } | undefined)?.value;
|
||||||
|
|
||||||
if (domain) {
|
if (domain) {
|
||||||
query = query
|
query = query.where('events.pubkey', 'in', (eb) =>
|
||||||
.innerJoin('pubkey_domains', 'pubkey_domains.pubkey', 'events.pubkey')
|
eb.selectFrom('pubkey_domains').select('pubkey').where('domain', '=', domain));
|
||||||
.where('pubkey_domains.domain', '=', domain);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const q = tokens.filter((t) =>
|
const q = tokens.filter((t) =>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue