Wait, I didn't finish that thought :-P
So the necessary rearchitecture would involve delivering the
messageblks
first into a memory table, and only copying them into an on-disk
table if
there are local recipients. I believe that this method was used in an
early pre-1.0 version of DBMail, and replaced with a locally in-memory
system, which I replaced with the internal user system. My way makes
it
possible to store arbitrarily large messages without requiring them
to be
in memory all at once, which I think is a pretty important part of the
design. **
PostgreSQL temp tables are not "memory tables", they do and can write
to disk, they are just more efficient since they are designed not to
persist through a crash.
Exactly. Think of TEMP tables as PostgreSQL's MySQL imitation:
non-reliable data storage that's really fast. To be honest, if MySQL
users wanted to come closer to benchmarking MySQL and PostgreSQL in an
apples to apples comparison, have the data inserted into a TEMP table,
then wrap all statements in a transaction. TEMP tables really are fast
since they don't have any transaction overhead attached to them, just
be warned that large data sets in TEMP tables still need to have
INDEXes added and need to be ANALYZEd (not that it's applicable in this
case, but still). -sc
--
Sean Chittenden