GX-Bug #65261
geschlossenE-Mail Seite funktioniert bei sehr vielen E-Mails > 100000 nicht mehr. / E-mail page does not work anymore with many e-mails > 100000.
100%
Filter werden nur dann angewendet, wenn ein Teil des Textes im Filterfeld eingegeben wird. Es wurden einige Indizes erstellt, um die Leistung der Suche in den Tabellen emails und email_contacts zu erhöhen.
Beschreibung
E-Mail Seite funktioniert bei sehr vielen E-Mails > 100000 nicht mehr, da hier dann die SQL Befehle extrem inperformant sind. Hier wäre eine Lösung den SQL Befehl aufzuspalten und in mehrere SQL Befehl umzuschreiben.
- Suchen bzw. Filtern
- die IDs aus dem anderen Tabellen raussuchen
- mit Order by sortieren
- nur 20 Einträge mit Limit anzeigen
E-Mail page does not work with many e-mails > 100000, because the SQL commands are extremely inperformant. Here a solution would be to split the SQL command and rewrite it into several SQL commands.
- search or filter
- select the IDs from the other tables
- sort with Order by
- show only 20 entries with limit
SELECT DISTINCT emails.*
FROM emails
LEFT JOIN email_contacts ON email_contacts.email_id = emails.email_id
LEFT JOIN email_attachments ON email_attachments.email_id = emails.email_id
WHERE emails.subject LIKE '%%' ESCAPE '!'
OR emails.content_html LIKE '%%' ESCAPE '!'
OR emails.content_plain LIKE '%%' ESCAPE '!'
OR emails.creation_date LIKE '%%' ESCAPE '!'
OR emails.sent_date LIKE '%%' ESCAPE '!'
OR email_contacts.email_address LIKE '%%' ESCAPE '!'
OR email_contacts.contact_name LIKE '%%' ESCAPE '!'
OR email_attachments.path LIKE '%%' ESCAPE '!'
OR email_attachments.name LIKE '%%' ESCAPE '!'
ORDER BY creation_date DESC
LIMIT 20