Re: Further pg_upgrade analysis for many tables - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: Further pg_upgrade analysis for many tables
Date
Msg-id CAMkU=1z2mFVRPiPrhqLD+LB3uShKp_X+Eg_8CUnwERoiJOjrqg@mail.gmail.com
Whole thread Raw
In response to Re: Further pg_upgrade analysis for many tables  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-hackers
On Fri, Nov 9, 2012 at 10:50 AM, Jeff Janes <jeff.janes@gmail.com> wrote:
> On Thu, Nov 8, 2012 at 9:50 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Jeff Janes <jeff.janes@gmail.com> writes:
>>> Are sure the server you are dumping out of is head?
>>
>> I experimented a bit with dumping/restoring 16000 tables matching
>> Bruce's test case (ie, one serial column apiece).  The pg_dump profile
>> seems fairly flat, without any easy optimization targets.  But
>> restoring the dump script shows a rather interesting backend profile:
>>
>> samples  %        image name               symbol name
>> 30861    39.6289  postgres                 AtEOXact_RelationCache
>> 9911     12.7268  postgres                 hash_seq_search
> ...
>>
>> There are at least three ways we could whack that mole:
>>
>> * Run the psql script in --single-transaction mode, as I was mumbling
>> about the other day.  If we were doing AtEOXact_RelationCache only once,
>> rather than once per CREATE TABLE statement, it wouldn't be a problem.
>> Easy but has only a narrow scope of applicability.
>
> That is effective when loading into 9.3 (assuming you make
> max_locks_per_transaction large enough).  But when loading into  <9.3,
> using --single-transaction will evoke the quadratic behavior in the
> resource owner/lock table and make things worse rather than better.

Using --single-transaction gets around the AtEOXact_RelationCache
quadratic, but it activates another quadratic behavior, this one in
"get_tabstat_entry".   That is a good trade-off because that one has a
lower constant, but it is still going to bite.

Cheers,

Jeff



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Proof of concept: standalone backend with full FE/BE protocol
Next
From: Andrew Dunstan
Date:
Subject: vacuumlo - use a cursor