pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Sebastien Lemieux <slemieux@elitra.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Postgresql-performance <pgsql-performance@postgresql.org>
Subject: Re: How to efficiently duplicate a whole schema?
Date: Wed, 6 Aug 2003 14:41:43 -0700 (PDT)
Message-ID: <20030806143746.J7786-100000@megazone.bigpanda.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0308061605540.10321-100000@moebius.elitra.com>

On Wed, 6 Aug 2003, Sebastien Lemieux wrote:

> On Wed, 6 Aug 2003, Tom Lane wrote:
>
> > Sebastien Lemieux <slemieux@elitra.com> writes:
> > > All the time is taken at the commit of both transaction.
> >
> > Sounds like the culprit is foreign-key checks.
> >
> > One obvious question is whether you have your foreign keys set up
> > efficiently in the first place.  As a rule, the referenced and
> > referencing columns should have identical datatypes and both should
> > be indexed.  (PG will often let you create foreign key constraints
> > that don't meet these rules ... but performance will suffer.)
>
> I've checked and all the foreign keys are setup between 'serial' (the
> primary key of the referenced table) and 'integer not null' (the foreign
> key field).  Would that be same type?  A couple of my foreign keys are not
> indexed, I'll fix that.  The latter seems to do the job, since I can now
> synchronize in about 75 seconds (compared to 30 minutes), which seems good
> enough.

Another thing might be the management of the trigger queue.  I don't think
7.3.2 had the optimization for limiting the scans of the queue when you
have lots of deferred triggers.  It looks like 7.3.4 may though.




view thread (11+ messages)  latest in thread

Message-ID: <20030806143746.J7786-100000@megazone.bigpanda.com>
Permalink:  ../20030806143746.J7786-100000@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20030806143746.J7786-100000@megazone.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: sszabo@megazone.bigpanda.com, slemieux@elitra.com, tgl@sss.pgh.pa.us
  Subject: Re: How to efficiently duplicate a whole schema?
  In-Reply-To: <20030806143746.J7786-100000@megazone.bigpanda.com>
  References: <Pine.LNX.4.33.0308061605540.10321-100000@moebius.elitra.com> <20030806143746.J7786-100000@megazone.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox