> I'm going to brute-force by trying combinations until
> I get the wanted results now, but I do not really feel
> well with doing this as it might be wrong in corner-cases.

Well, I think I have mostly figured out the basics of the
new schema now. So I made a simple drop-in replacement select
statement that just pulls out message-id, size, seen_flag and
timestamp. Problem is, the new layout results in a join of
4 tables instead of 1. And the result is that it takes about
5 times as long to execute.

Due to my mailer breaking the lines i have split up the query:
---
SELECT DISTINCT physmessage.id, physmessage.messagesize,
messages.seen_flag, physmessage.internal_date 

FROM dbmail_mailboxes mailboxes, dbmail_messages messages,
dbmail_physmessage physmessage, dbmail_messageblks messageblks 

WHERE mailboxes.owner_idnr='4' AND messages.status<'2'

AND mailboxes.mailbox_idnr=messages.mailbox_idnr AND
messages.physmessage_id=physmessage.id AND
messages.physmessage_id=messageblks.physmessage_id

ORDER BY physmessage.id DESC
---

Is this the best way to extract the wanted values, or are
there any shortcuts that can be made?

I really wish we had preparsed headers now..

-=Dead2=-

Reply via email to