Skip to content
Snippets Groups Projects
Unverified Commit ea899860 authored by Kevin Aleman's avatar Kevin Aleman Committed by GitHub
Browse files

fix: Performance issue on Messages.countByType aggregation (#30062)

parent 6c158b10
No related branches found
No related tags found
No related merge requests found
---
"@rocket.chat/meteor": patch
---
fix: Performance issue on `Messages.countByType` aggregation caused by unindexed property on messages collection
......@@ -101,7 +101,7 @@ async function getEEStatistics(): Promise<EEOnlyStats | undefined> {
statsPms.push(
// Total livechat monitors
Users.col.countDocuments({ type: 'livechat-monitor' }).then((count) => {
Users.col.countDocuments({ roles: 'livechat-monitor' }).then((count) => {
statistics.livechatMonitors = count;
return true;
}),
......
......@@ -77,6 +77,7 @@ export class MessagesRaw extends BaseRaw<IMessage> implements IMessagesModel {
{ key: { 'navigation.token': 1 }, sparse: true },
{ key: { 'federation.eventId': 1 }, sparse: true },
{ key: { t: 1 }, sparse: true },
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment