Hi Aaron,

>>now I have only one slow query left - unfortunately I have no idea why
>>it is that slow. The mailbox contains ~1800 mails. It takes 45 seconds
>>to open it:
>>
>>SELECT seen_flag, answered_flag, deleted_flag, flagged_flag, draft_flag,
>>recent_flag, TO_CHAR(internal_date, 'YYYY-MM-DD HH24:MI:SS' ), rfcsize,
>>message_idnr FROM dbmail_messages msg, dbmail_physmessage pm WHERE pm.id
>>= msg.physmessage_id AND message_idnr BETWEEN '1' AND '417966' AND
>>mailbox_idnr = '81' AND status < '2' ORDER BY message_idnr ASC
> 
> Wild. Swapping in the MySQL function for TO_CHAR, then running on my
> mailbox takes 0.32 seconds for 4518 rows (I didn't change your numbers
> except the mailbox idnr).

That is fast (MyISAM or InnoDB?), but I would expect something below 1s too.

If no one has an idea what could be wrong I'll ask on the PostgreSQL sql
list tomorrow.


Thomas
-- 
http://www.tmueller.com for pgp key (95702B3B)

Reply via email to