mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd:Ⓜ️ Optimize room::members::count w/ event::fetch::opts keys select.
This commit is contained in:
parent
65b516e4c0
commit
559c2f008c
1 changed files with 17 additions and 1 deletions
|
@ -1448,9 +1448,25 @@ const
|
|||
return ret;
|
||||
}
|
||||
|
||||
// The list of event fields to fetch for the closure
|
||||
static const event::keys keys
|
||||
{
|
||||
event::keys::include
|
||||
{
|
||||
"event_id", // Added for any upstack usage (but may be unnecessary).
|
||||
"membership", // Required for membership test.
|
||||
"content", // Required because synapse events randomly have no event.membership
|
||||
}
|
||||
};
|
||||
|
||||
const m::event::fetch::opts fopts
|
||||
{
|
||||
keys, room.fopts? room.fopts->gopts : db::gopts{}
|
||||
};
|
||||
|
||||
const room::state state
|
||||
{
|
||||
room
|
||||
room, &fopts
|
||||
};
|
||||
|
||||
size_t ret{0};
|
||||
|
|
Loading…
Reference in a new issue