0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 02:02:38 +01:00

ircd:Ⓜ️ Optimize room::members::count w/ event::fetch::opts keys select.

This commit is contained in:
Jason Volk 2018-05-20 20:26:45 -07:00
parent 65b516e4c0
commit 559c2f008c

View file

@ -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};