SQL Redux

Christopher Hicks chicks at CHICKS.NET
Tue Aug 5 06:47:46 IST 2003


I haven't been following this discussion so if this has already been
mentioned please accept my apologies.

On Mon, 4 Aug 2003, Julian Field wrote:
> At 14:29 04/08/2003, you wrote:
> >If there's really no performance hit to logging after every email instead of
> >in batches, I'll see about changing my code to do it that way too. Nothing
> >worse than having to wait for all of the children to finish logging before I
> >can do a full restart of MailScanner.
>
> There must be a significant performance hit. In one case you are just
> appending a line to a file. In the other case you are adding a record to a
> database table and updating various indices. This *has* to be a much bigger
> operation than just adding 1 line to a file.

By doing an "insert delayed" you let MySQL batch things up for when it's
convenient to do it.  I'm sure there's still some overhead beyond simply
writing to a file, but maybe it's not so bad.  We use this for web logging
and haven't noticed any problems.

Keeping only a few indexes in the current logging table and periodically
moving that into a fully indexed historic data set table would let that
extra index processing be done in off times.

--
</chris>

The death of democracy is not likely to be an assassination from ambush. It
will be a slow extinction from apathy, indifference, and undernourishment.
-Robert Maynard Hutchins, educator (1899-1977)



More information about the MailScanner mailing list