mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Merge branch 'make-search-domain-faster' into 'main'
Make domain:<domain> search faster See merge request soapbox-pub/ditto!604
This commit is contained in:
commit
e3cc6922ae
1 changed files with 3 additions and 2 deletions
|
|
@ -79,10 +79,11 @@ export async function getIdsBySearch(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (domains.size) {
|
if (domains.size) {
|
||||||
const pubkeys = kysely
|
const pubkeys = (await kysely
|
||||||
.selectFrom('pubkey_domains')
|
.selectFrom('pubkey_domains')
|
||||||
.select('pubkey')
|
.select('pubkey')
|
||||||
.where('domain', 'in', [...domains]);
|
.where('domain', 'in', [...domains])
|
||||||
|
.execute()).map(({ pubkey }) => pubkey);
|
||||||
|
|
||||||
query = query.where('pubkey', 'in', pubkeys);
|
query = query.where('pubkey', 'in', pubkeys);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue