Re: How to improve insert speed with index on text column

From: Andy Colson <andy(at)squeakycode(dot)net>
To: Saurabh <saurabh(dot)b85(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: How to improve insert speed with index on text column
Date: 2012-01-30 18:33:00
Message-ID: 4F26E25C.1020402@squeakycode.net
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-performance

On 1/30/2012 3:27 AM, Saurabh wrote:
> Hi all,
>
> I am using Postgresql database for our project and doing some
> performance testing. We need to insert millions of record with indexed
> columns. We have 5 columns in table. I created index on integer only
> then performance is good but when I created index on text column as
> well then the performance reduced to 1/8th times. My question is how I
> can improve performance when inserting data using index on text
> column?
>
> Thanks,
> Saurabh
>

Do it in a single transaction, and use COPY.

-Andy

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Alessandro Gagliardi 2012-01-30 19:13:08 Why should such a simple query over indexed columns be so slow?
Previous Message Claudio Freire 2012-01-30 18:20:28 Re: How to improve insert speed with index on text column