Micah Stevens ([EMAIL PROTECTED]) wrote:
>
>Just a note, on your query comments, although I'm not arguing with your
>basic point, it's always been my understanding that SELECT statements that
>use '*' instead of stating field names are slower. If you don't specify the
>field names the database has to spend time figuring out what they are, but
>if you name them all it has to do it error if it can't find the name.
>
>In practice I've noticed it to be only marginally faster to explicitly name
>the fields rather than use the '*' wildcard. Not really noticeable unless
>you're doing tons of SELECT statements.

Either or not use wildcards it should be faster to get the header in one query
instead of five, I think.

>Back to the point of your mail though: Is it faster to make one big
>conglomerate SQL statement that takes the database longer to parse? If it's
>the difference between one connection, and two, I doubt it, but the more
>you slim things down the better. That's for sure.

If the message is stored directly in "messages" instead of "messages"
+ "messageblks" the query look like:

"SELECT * FROM messages WHERE message_idnr = <msg_nbr> AND status<2 AND 
unique_id !
= '' AND mailbox_idnr = <mbox>"

...or for exemple:

"SELECT from,to,subject,seen_flag FROM messages WHERE message_idnr = <msg_nbr> 
AND
status<2 AND unique_id != '' AND mailbox_idnr = <mbox>"

My second question: why to use the extra table messageblks to store the message 
?

Thanks for spend your time to reply to my questions.

Sam.

>At 03:26 AM 9/24/2002 +0200, you wrote:
>>Hi,
>>
>>We have noticed that and make some tests with several Webmail and mail
>>clients as Netscape, Outlook, vs courier-imap with the same mail
>>clients.
>>
>>First conclusions the PHPs' webmails are very slow except Squirrelmail
>>because it use its own imap libraries instead of PHP-IMAP. But it's true
>>Courier-IMAP it's much faster than dbmail-imap, we have add the mysql
>>indexes as explained in this list, tuned the mysql config and got some
>>improvements but never too fast as courier-imap.
>>
>>Then we have put the trace_level to 5 and make the same tests and we
>>have noticed that to get each mail header dbmail-imap need 4 or 5
>>queries and in my opinion I think that it should be possible to get the
>>same think with only one or two:
>>
>>By use a "SELECT * FROM messages" instead "SELECT field-1, field-2..."
>>and/or change the table structure to put the mail header on "messages"
>>whith the from:, to:, subject:, field and perhaps the body too, or just
>>the body on messageblks.
>>
>>DBmail is the right way to make an isp mail solution with a lot of
>>capabilities as CRM, etc, but we have to improve its speed and discuss
>>to find the best way to do.
>>
--
Sam Przyswa - Chef de projet
Arial Concept - Intégrateur Internet
36, rue de Turin - 75008 - Paris
Tel: 01 40 54 86 04 - Fax: 01 40 54 83 01
Web: http://www.arial-concept.com - Email: [EMAIL PROTECTED]


Reply via email to