Skip site navigation (1) Skip section navigation (2)

Re: Copy performance issues

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Saadat Anwar <sanwar(at)asu(dot)edu>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Copy performance issues
Date: 2010-08-18 22:42:14
Message-ID: 15118.1282171334@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Saadat Anwar <sanwar(at)asu(dot)edu> writes:
> I am having severe COPY performance issues after adding indices. What used
> to take a few minutes (without indices) now takes several hours (with
> indices). I've tried to tweak the database configuration (based on Postgres
> documentation and forums), but it hasn't helped as yet. Perhaps, I haven't
> increased the limits sufficiently. Dropping and recreating indices may not
> be an option due to a long time it takes to rebuild all indices.

I suspect your problem is basically that the index updates require a
working set larger than available RAM, so the machine spends all its
time shuffling index pages in and out.  Can you reorder the input so
that there's more locality of reference in the index values?

Also, my first reaction to that schema is to wonder whether the lat/lon
indexes are worth anything.  What sort of queries are you using them
for, and have you considered an rtree/gist index instead?

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Greg SmithDate: 2010-08-18 22:49:50
Subject: Re: Copy performance issues
Previous:From: Samuel GendlerDate: 2010-08-18 22:06:43
Subject: Re: write barrier question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group