
michael.monnerie at is
Jan 17, 2009, 10:07 AM
Views: 917
Permalink
|
Paul, I'm now running dbmail 2.2 internally. I have my kmail open, and want to browse between folders and read my messages. That was horribly slow, so I looked what's up and found this query running: SELECT message_idnr FROM dbmail_messages m JOIN dbmail_physmessage p ON m.physmessage_id=p.id JOIN dbmail_headervalue v on v.physmessage_id=p.id WHERE mailbox_idnr = 3236 AND status IN (0,1) AND SUBSTRING(headervalue,0,255) ILIKE '%kwf%' ORDER BY message_idnr; Looks like kmail runs a query, searching for "%kwf%" somewhere in a header from all messages in a mailbox. Any ideas why? It wasn't me *-) Could kwf have a special meaning? EXPLAIN ANALYZE: QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Sort (cost=281008.95..281009.22 rows=109 width=8) (actual time=92589.164..92589.166 rows=2 loops=1) Sort Key: m.message_idnr Sort Method: quicksort Memory: 25kB -> Nested Loop (cost=297.16..281005.26 rows=109 width=8) (actual time=52791.256..92586.765 rows=2 loops=1) -> Hash Join (cost=297.16..280143.98 rows=109 width=24) (actual time=52780.774..92576.224 rows=2 loops=1) Hash Cond: (v.physmessage_id = m.physmessage_id) -> Seq Scan on dbmail_headervalue v (cost=0.00..279773.17 rows=4837 width=8) (actual time=96.491..92524.032 rows=180 loops=1) Filter: ("substring"(headervalue, 0, 255) ~~* '%kwf%'::text) -> Hash (cost=232.28..232.28 rows=5191 width=16) (actual time=51.200..51.200 rows=5180 loops=1) -> Index Scan using dbmail_messages_1 on dbmail_messages m (cost=0.00..232.28 rows=5191 width=16) (actual time=21.516..42.687 rows=5180 loops=1) Index Cond: (mailbox_idnr = 3236) Filter: (status = ANY ('{0,1}'::integer[])) -> Index Scan using dbmail_physmessage_pkey on dbmail_physmessage p (cost=0.00..7.89 rows=1 width=8) (actual time=5.254..5.257 rows=1 loops=2) Index Cond: (p.id = m.physmessage_id) Total runtime: 92600.940 ms (15 Zeilen) mfg zmi -- // Michael Monnerie, Ing.BSc ----- http://it-management.at // Tel: 0660 / 415 65 31 .network.your.ideas. // PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import" // Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4 // Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4 _______________________________________________ DBmail mailing list DBmail[at]dbmail.org https://mailman.fastxs.nl/mailman/listinfo/dbmail
|