Gianni Mariani wrote:
lou wrote:
<snip>
b) dbmail could also use stored procedures in Postgresql. This
would eliminate a bunch of processing on the server.
[...]
why? it will break portability with other servers like mysql. Also
that means all the
load to be pushed to the database server rather than the client
(dbmail server).
(MySQL have stored procedures in 4.0.x or?)
<snip>
yes, but can you make it learn, or write it so generically.
This is imap/mail we're talking about. It's a done deal. You have a
dozen or 2 imap commands. Implement each one as a stored procedure (or
set of procedures). Simple 1.Parse imap message 2.call stored procedure
3,return result. Have a generic mapping from command to stored
procedure and you can probably write all the stored procedures in an
afternoon. Changes to the schema and procedures means you won't even
need to re-start the imap server ....
<snip>
I beleive Gianni has a point, even though I run mysql.
Let's take the IMAP server as an example.
1. Parse IMAP message
2. Call C-function that defines the IMAP command.
3. The C function calls the stored procedure , when applicable
(PostgreSQL) or performs the required SQL commands (MySQL).
4. Return result
But what is the performance gain? Is it worth the effort. I do
beleive this is the more elegant way to implement the database
access, but we will get two quite different code bases.
I also beleive it is better to implement these changes, if they
are necessay as soon as possible.
But remember we have got a quite stable product right now.
/Magnus