Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching via search bar takes very long time in large mailboxes #10448

Open
thstyl2000 opened this issue Dec 6, 2024 · 3 comments
Open

Searching via search bar takes very long time in large mailboxes #10448

thstyl2000 opened this issue Dec 6, 2024 · 3 comments

Comments

@thstyl2000
Copy link

thstyl2000 commented Dec 6, 2024

Steps to reproduce

  1. Go to a mailbox containing a lot of emails
  2. Search for something using the search bar

Expected behavior

You get a results in an acceptable amount of time.

Actual behavior

You get no results.

Mail app version

4.0.7

Nextcloud version

30.0.2

Mailserver or service

dovecot (imap)

Operating system

freebsd

PHP engine version

PHP 8.2

Nextcloud memory caching

'memcache.local' => '\OC\Memcache\APCu', 'memcache.locking' => '\OC\Memcache\Redis',

Web server

Nginx

Database

MariaDB

Additional info

The problem is because it also defaults to searching in the mail body (which is probably very expensive). Searching via the "Extra Settings" window (next to the bar) and using only one field returns results extremely quickly also in very very large mailboxes.

@SebastianKrupinski
Copy link
Contributor

Hi @thstyl2000

We don't actual do a full body search, the body is only pulled for messages that have NOT been processed by our background worker, so that the structure and preview text can be analyzed.

The background job is "OCA\Mail\BackgroundJob\PreviewEnhancementProcessingJob" if you run the cron.php this should no longer pull the body of the message. Also after running a search once those messages should no longer be pulled again.

@thstyl2000
Copy link
Author

I've tested this in my "Archive" mailbox which is huge, but I suppose that most of the message bodies must have already been pulled, since I've read all emails before archiving them. So what I'm inferring from your comment is that the background job has not been doing its job properly, or do I understand it wrong....?

@ChristophWurst
Copy link
Member

Dear @thstyl2000,
Thank you very much for your report.

The app indeed searches in bodies, but it is opt-in due to the potential performance implications. See #8050 for details.
If you turn off body search globally, do you get faster results?

Prepocessing is irrelevant for search. The app can search for subject, flags and senders/recipients in the database. For searches in the message body the IMAP server is always contacted.

I hope this information allows you to narrow down where the bottleneck lies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants