Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 4F266197AB87 for ; Mon, 30 Jan 2012 14:33:16 -0400 (AST) Received: from li339-205.members.linode.com ([96.126.114.205] helo=squeakycode.net) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rrw2T-0005Mh-UK for pgsql-performance@postgresql.org; Mon, 30 Jan 2012 18:33:15 +0000 Received: from [192.168.10.84] (97-64-237-59.client.mchsi.com [97.64.237.59]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: andy) by squeakycode.net (Postfix) with ESMTPSA id CC1371682B; Mon, 30 Jan 2012 12:33:14 -0600 (CST) Message-ID: <4F26E25C.1020402@squeakycode.net> Date: Mon, 30 Jan 2012 12:33:00 -0600 From: Andy Colson User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Saurabh CC: pgsql-performance@postgresql.org Subject: Re: How to improve insert speed with index on text column References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201201/124 X-Sequence-Number: 46136 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