Add an index specifically for improving thread count perf.

This commit is contained in:
Greyson Parrelli
2023-09-01 11:45:36 -04:00
committed by Nicholas Tinsley
parent bc1c8032c1
commit 494b2c6786
6 changed files with 42 additions and 37 deletions

View File

@@ -373,10 +373,8 @@ public final class MessageRequestRepository {
@WorkerThread
private boolean isLegacyThread(@NonNull Recipient recipient) {
Context context = ApplicationDependencies.getApplication();
Long threadId = SignalDatabase.threads().getThreadIdFor(recipient.getId());
Long threadId = SignalDatabase.threads().getThreadIdFor(recipient.getId());
return threadId != null &&
(RecipientUtil.hasSentMessageInThread(threadId) || RecipientUtil.isPreMessageRequestThread(threadId));
return threadId != null && RecipientUtil.hasSentMessageInThread(threadId);
}
}