pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Merlin Moncure <mmoncure@gmail.com>
To: Scott Marlowe <smarlowe@g2switchworks.com>
Cc: Carlo Stonebanks <stonec.register@sympatico.ca>
Cc: pgsql-performance@postgresql.org
Subject: Re: Performance Optimization for Dummies 2 - the SQL
Date: Fri, 6 Oct 2006 14:53:35 -0400
Message-ID: <b42b73150610061153i3d11d7a4r23e1d7c5317feb9f@mail.gmail.com> (raw)
In-Reply-To: <1160153623.6181.13.camel@state.g2switchworks.com>
References: <eft782$5a1$1@news.hub.org>
	<b42b73150610031221y4955e663ped999a83a810d318@mail.gmail.com>
	<eg0u6e$hbr$1@news.hub.org>
	<b42b73150610041407y3554f311u1329c4f3bdc53999@mail.gmail.com>
	<eg1dai$1tfa$1@news.hub.org>
	<b42b73150610042326v7fdeed17rf6b96e52a681a6db@mail.gmail.com>
	<eg2cds$29en$1@news.hub.org>
	<b42b73150610050630t76e9eedeh45a382729d35f2f6@mail.gmail.com>
	<eg611q$l0m$1@news.hub.org>
	<1160153623.6181.13.camel@state.g2switchworks.com>

On 10/6/06, Scott Marlowe <smarlowe@g2switchworks.com> wrote:
> On Fri, 2006-10-06 at 11:44, Carlo Stonebanks wrote:
> > This didn't work right away, but DID work after running a VACUUM FULL. In
> > other words, i was still stuck with a sequential scan until after the
> > vacuum.
> >
> > I turned autovacuum off in order to help with the import, but was perfoming
> > an ANALYZE with every 500 rows imported.

how did you determine that it is done every 500 rows? this is the
default autovacuum paramater.  if you followed my earlier
recommendations, you are aware that autovacuum (which also analyzes)
is not running during bulk inserts, right?

imo, best way to do big data import/conversion is to:
1. turn off all extra features, like stats, logs, etc
2. use copy interface to load data into scratch tables with probably
all text fields
3. analyze (just once)
4. use big queries to transform, normalize, etc
5. drop scratch tables
6. set up postgresql.conf for production use, fsync, stats, etc

important feature of analyze is to tell the planner approx. how big
the tables are.

merlin



view thread (38+ messages)  latest in thread

Message-ID: <b42b73150610061153i3d11d7a4r23e1d7c5317feb9f@mail.gmail.com>
Permalink:  ../b42b73150610061153i3d11d7a4r23e1d7c5317feb9f@mail.gmail.com/
Also on:    postgresql.org/message-id/b42b73150610061153i3d11d7a4r23e1d7c5317feb9f@mail.gmail.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: mmoncure@gmail.com, smarlowe@g2switchworks.com, stonec.register@sympatico.ca
  Subject: Re: Performance Optimization for Dummies 2 - the SQL
  In-Reply-To: <b42b73150610061153i3d11d7a4r23e1d7c5317feb9f@mail.gmail.com>
  References: <eft782$5a1$1@news.hub.org> <b42b73150610031221y4955e663ped999a83a810d318@mail.gmail.com> <eg0u6e$hbr$1@news.hub.org> <b42b73150610041407y3554f311u1329c4f3bdc53999@mail.gmail.com> <eg1dai$1tfa$1@news.hub.org> <b42b73150610042326v7fdeed17rf6b96e52a681a6db@mail.gmail.com> <eg2cds$29en$1@news.hub.org> <b42b73150610050630t76e9eedeh45a382729d35f2f6@mail.gmail.com> <eg611q$l0m$1@news.hub.org> <1160153623.6181.13.camel@state.g2switchworks.com> <b42b73150610061153i3d11d7a4r23e1d7c5317feb9f@mail.gmail.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