Re: Performance issue with cross table updates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Gibson <craiggib(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Performance issue with cross table updates
Date: 2012-09-10 18:11:50
Message-ID: 27226.1347300710@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Craig Gibson <craiggib(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Edson Richter 2012-09-10 18:13:15 Compressed binary field
Previous Message David Johnston 2012-09-10 17:40:27 Re: Performance issue with cross table updates