Guy wrote:
Hi,
I'm busy setting up a pair of new MySQL servers. The bulk of the work
the current servers do is handle queries from postfix and I'm doing a
lot of reading and learning about MySQL tweaking and suchlike.
Our current postfix set up has a lot of convoluted queries (a lot of
UNION type queries), mostly because of legacy database design. I'm
just curious whether postfix can currently handle using stored
procedures instead of plain MySQL queries? Just thinking of ways to
simply and hopefully improve performance for our postfix set up and I
noticed some vague mention of stored procedures in postfix on a mail
archive.
If it can be done, has anyone played with stored procedures in postfix
and what did it help you at all?
I ran into a problem trying to use them. Postfix can't handle multiple
result sets being returned, which most stored procedures will produce
(if you do more than one query in the procedure). However, the way
Postfix traverses the maps (sequentially, until success) provided an
alternative solution to my problem (I know your problem may be
different). I also added a new table just for Postfix in our existing
database, consisting solely of source and destination addresses, to
eliminate the requires joins and unions. It does result in some data
duplication, but I believe the large increase in simplicity makes it
worthwhile.
Thanks
Guy