Re: slow commits with heavy temp table usage in 8.4.0 - Mailing list pgsql-hackers

From Todd A. Cook
Subject Re: slow commits with heavy temp table usage in 8.4.0
Date
Msg-id 4A7C514D.6080101@blackducksoftware.com
Whole thread Raw
In response to Re: slow commits with heavy temp table usage in 8.4.0  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: slow commits with heavy temp table usage in 8.4.0  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> 
> Actually, this is easier than I thought, because there is already
> bookkeeping being done that (in effect) tracks whether a table has
> already been truncated in the current transaction.  So we can rely
> on that, and with only a very few lines of code added, ensure that
> a situation like this does only one full-scale transaction-safe
> truncation per transaction.  The attached prototype patch does this
> and seems to fix the speed problem nicely.  It's not tremendously
> well tested, but perhaps you'd like to test?  Should work in 8.4.

I downloaded the 8.4 source, built it unmodified, created a new cluster,
and ran the test in an empty DB there.  Function execution took about
230 seconds, and commit took about 6 seconds.

With the patch applied, the test only took 35 seconds, and the commit
was practically instant (30ms).  I monitored the database directory,
and the test execution only created 2 files (down from 60000).

Thanks for the patch; it looks great. :)

Is there any chance that it will be backpatched to 8.4?

-- todd


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: mixed, named notation support
Next
From: Alvaro Herrera
Date:
Subject: Re: Split-up ECPG patches