Re: imap search query
Thomas Raschbacher <[email protected]>
| Newsgroups | gmane.mail.imap.dbmail |
|---|---|
| Message-ID | <[email protected]> |
Am 05.03.2015 um 17:28 schrieb Jure Pečar: > On Wed, 4 Mar 2015 13:21:04 +0100 > Jure Pečar <[email protected]> wrote: > >> SELECT DISTINCT m.message_idnr FROM dbmail_mimeparts p >> LEFT JOIN dbmail_partlists l ON p.id=l.part_id >> LEFT JOIN dbmail_physmessage s ON l.physmessage_id=s.id >> LEFT JOIN dbmail_messages m ON m.physmessage_id=s.id >> LEFT JOIN dbmail_mailboxes b ON m.mailbox_idnr = b.mailbox_idnr >> WHERE b.mailbox_idnr=87 AND m.status IN (0,1) AND (l.part_key > 1 OR l.is_header=0) AND p.data LIKE BINARY '%Gls%' >> ORDER BY m.message_idnr > > My conclusions about this query are: > > * dbmail_mimeparts.data is type longblob > * ORDER BY requires temp table > * which could go to memory table, but it does not support blob/text types, therefore it goes to disk > * LIKE begins with %, therefore it cannot use indexes > * which means full table scan > * on disk :D > > Also LIKE BINARY is many times (3+) slower then LIKE. The only difference between the two is that one is case sensitive while the other is not. > > Things we could investigate: > * changing dbmail_mimeparts.data type to something that memory engine supports > * like / like binary ... do we need case sensitivity? > * mysql 5.6 full text search? > * external indexing? > > Paul? > > I recon something like supporting mysql 5.6 full text search would cause problems, since it is not the only supported RDBMS. I think paul told me once dbmail doesn'T use stored procedures, because some backend (i think just sqlite) doesn't support it. So if one were to put in some full text capability it would have to work everywhere - and emulate where not ? .. which i guess would be difficult. _______________________________________________ DBmail mailing list [email protected] http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail
signature.asc
(application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJU+U25AAoJEM5rhUtKyvU6dikP/iULKZx5VdHhupOYa6qIQTza bim1gxE9j+YqPoXuctDwGxvaG1I4oYZtRSt192XcREsXfyxmiqaYxTAUEchbM4oc WeH+RZ+MuVg/Kn85ld44C96X7WmPvVew0b2Vi8XvyrYUfoADE+Qf1b001FZHOxix HuEf1AlDN04jHZdA5UJptwet6rYPPaxyIruKZBKqxZw2Za7pwS7eciABm5/f77Du NRlYsi7LRPN1/8vBms/2/iepsxjBvblsmQ45KiyqyctTFtsu+QOxQe3OzY/Pcsmd L5GMRkJn9gTYE4Iajc/IwO1ukSD1/OvL5+uWm/bV+nHJpF6IW5aLDj6oJWz121am bv6vCsLOQlOd8a2GiLrPEcjSX75cnwDWuD9DpxQdbqjDaF3vDIzx3q0x7v1xSA+B PsAHvO7ZgDnGSMcl43sDm2vrJf0xQQLXXTv69fNEcsHAf8Da6S+W9qjMtb05lMYL gDQLwqac4lrgEYId9RwWGIfxgWSolkVBCnLNvdXj1pthZ42/tV870IWLvqrMsmsS F4hGiZMSqMr8+d6CKnDl1S6PvBuTyX378THH2WwJVlKtoCPNi8JyfhkOusFyvjYk Q8sbXrM4wNJPTIMLe/ebYXii/n5gbGgrW3DKdz37iqdIqp76+/mLpSlyPmzkZB/C GgR9yK9kkbR98HnP3ef8 =q2oe -----END PGP SIGNATURE-----