Re: Performance issue with cross table updates - Mailing list pgsql-general

From Tom Lane
Subject Re: Performance issue with cross table updates
Date
Msg-id 27226.1347300710@sss.pgh.pa.us
Whole thread Raw
In response to Performance issue with cross table updates  (Craig Gibson <craiggib@gmail.com>)
List pgsql-general
Craig Gibson <craiggib@gmail.com> writes:
> I get a daily CSV file of 6.5 million records. I create a temporary
> table and COPY them in. On completion I create an index on the mdnid
> column. This column is also indexed in table 2. This part is very
> fast. I had some 'checkpoint too often' issues, but that I have
> resolved.

FWIW, you probably should also issue an ANALYZE on the temp table after
you've loaded it.  If you skip that, the planner is working blind as to
column statistics and is quite likely to choose inappropriate plans.

I concur with the other comment that you might be able to make this a
lot faster if you could convert it into a couple of multiple-row
commands instead of doing a manual loop.  But you'd need up-to-date
statistics to get a decent plan for that, too ...

            regards, tom lane


pgsql-general by date:

Previous
From: "David Johnston"
Date:
Subject: Re: Performance issue with cross table updates
Next
From: Edson Richter
Date:
Subject: Compressed binary field