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:
Alex Gleason 2024-12-09 14:49:18 +00:00
commit e3cc6922ae

View file

@ -79,10 +79,11 @@ export async function getIdsBySearch(
}
if (domains.size) {
const pubkeys = kysely
const pubkeys = (await kysely
.selectFrom('pubkey_domains')
.select('pubkey')
.where('domain', 'in', [...domains]);
.where('domain', 'in', [...domains])
.execute()).map(({ pubkey }) => pubkey);
query = query.where('pubkey', 'in', pubkeys);
}