Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 160B8133798F for ; Tue, 2 Nov 2010 09:51:16 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 26965-07 for ; Tue, 2 Nov 2010 12:51:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm23.bullet.mail.ac4.yahoo.com (nm23.bullet.mail.ac4.yahoo.com [98.139.52.220]) by mail.postgresql.org (Postfix) with SMTP id 5DDF8133616B for ; Tue, 2 Nov 2010 09:51:08 -0300 (ADT) Received: from [98.139.52.197] by nm23.bullet.mail.ac4.yahoo.com with NNFMP; 02 Nov 2010 12:51:07 -0000 Received: from [98.139.52.175] by tm10.bullet.mail.ac4.yahoo.com with NNFMP; 02 Nov 2010 12:51:07 -0000 Received: from [127.0.0.1] by omp1058.mail.ac4.yahoo.com with NNFMP; 02 Nov 2010 12:51:07 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 786480.10466.bm@omp1058.mail.ac4.yahoo.com Received: (qmail 40481 invoked by uid 60001); 2 Nov 2010 12:51:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1288702267; bh=A5YNkOJMdlLZi2rl/CMDMLqvyZixosEauJD4ByPWFbY=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=E7GtFM//bDjJ5N7tuRxkODxie0Z7qet7L9wdVRjzlIYkftSKodjc2rf3HcXJKv4OmZ8GDLRovloSDcDzeIl8d3IXBSRsCXNefb3A11oMb82m5DhIZnCNWxqdexNVFbLYN5mh8Y/qi4P/LiCUburlBi6Nh+QsOBBEx7AxAlxz/18= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=Ps1nrte0jJ55XFvh62oXdw61yQsgNCaeY/HUhvb9KvXR6AjpakD0PlbCOatnOvB/qFjAQBiu3P0m5sV0EyTw2yoWtC3am9yz+k+7ys3SOyHpSmqPH2o5xd1XdD1F1TE8T+oaMDHn6kbITGdXZUNcNSmKQRWW55w5ZINDxgIj9UQ=; Message-ID: <577700.37613.qm@web65406.mail.ac4.yahoo.com> X-YMail-OSG: 7Yn9ZY4VM1nK8N3lvWFWaJ7LvRI6haPitUWdQ8bm6cdZh4q .QKomqDZ3fVkPXAki0fXWOA5ydDyOy1Rr.5EnZI3eatFuvmnH_AKQJIzkZ7p lTva6PcJcaNxUL32caHXWgGF.g_kfHWmserYblMYp0qUWMQa2eo6IuH3_KGz aTGPwgpwuVM7m1QLLcGMU.qBXAakdQGP08IoeVgi2GcmwKg0ejfITWoFuEsx VhByaWREYi69oStQk_IqI1qxoyWhM_8frqgl.OrP8xN3AYc26aC7rEz6yWgI iD4xgu5.iA0dbosot8h9LXsGu54l9Y_p.QQbI8qkk0Ba.3A3bRytr4YjOHhX 8hfkNfuf52_0hwbUiuQ4_2OD1Z4Styreeorc- Received: from [194.237.142.20] by web65406.mail.ac4.yahoo.com via HTTP; Tue, 02 Nov 2010 05:51:07 PDT X-Mailer: YahooMailRC/504.5 YahooMailWebService/0.8.107.284920 References: <293254.80548.qm@web65413.mail.ac4.yahoo.com> <20101102094539.GA6686@depesz.com> Date: Tue, 2 Nov 2010 05:51:07 -0700 (PDT) From: Divakar Singh Subject: Re: Insert performance with composite index To: =?iso-8859-1?Q?C=E9dric_Villemain?= , depesz@depesz.com Cc: pgsql-performance@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-150225514-1288702267=:37613" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.909 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/17 X-Sequence-Number: 41041 --0-150225514-1288702267=:37613 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable May be a query that is filtering based on these 2 columns?=0A=0A Best Regar= ds,=0ADivakar=0A=0A=0A=0A=0A________________________________=0AFrom: C=E9dr= ic Villemain =0ATo: depesz@depesz.com=0A= Cc: Divakar Singh ; pgsql-performance@postgresql.org=0A= Sent: Tue, November 2, 2010 4:34:42 PM=0ASubject: Re: [PERFORM] Insert perf= ormance with composite index=0A=0A2010/11/2 hubert depesz lubaczewski :=0A> On Mon, Nov 01, 2010 at 02:57:56PM +0100, C=E9dric Vill= emain wrote:=0A>> > CONSTRAINT tableindex_pkey PRIMARY KEY (tableindex)= =0A>> > )=0A>> > the index definition is=0A>> > CREATE INDEX "PK_AT2"=0A>> = > ON ABC=0A>> > USING btree=0A>> > (event, tableindex)=0A>> > TABLESP= ACE sample;=0A>>=0A>> Indexing twice the same column is useless. (perhaps m= ove your PK to=0A>> the tablespace 'sample' is good too ?)=0A>=0A> why do y= ou say that?=0A> these are not the same indexes and they serve different pu= rposes.=0A=0AGiven that tableindex is the PK column, I really like to now t= he usage=0Apattern for having it indexed twice.=0A=0A>=0A> Best regards,=0A= >=0A> depesz=0A>=0A> --=0A> Linkedin: http://www.linkedin.com/in/depesz / = blog: http://www.depesz.com/=0A> jid/gtalk: depesz@depesz.com / aim:depesz= hdl / skype:depesz_hdl / gg:6749007=0A>=0A=0A=0A=0A-- =0AC=E9dric Villemain= 2ndQuadrant=0Ahttp://2ndQuadrant.fr/ PostgreSQL : Expert= ise, Formation et Support=0A=0A-- =0ASent via pgsql-performance mailing lis= t (pgsql-performance@postgresql.org)=0ATo make changes to your subscription= :=0Ahttp://www.postgresql.org/mailpref/pgsql-performance=0A=0A=0A=0A --0-150225514-1288702267=:37613 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
May be a query that is filtering based on these 2 columns?
 = ;
Best Regards,
Divakar



From: C=E9dric Villemain <cedric.villemain.debian@gmail.com>
To: depesz@depesz.com
Cc: Divakar Singh <dpsmails@yahoo= .com>; pgsql-performance@postgresql.org
Sent: Tue, November 2, 2010 4:34:42 PM
Subject: Re: [PERFORM] Insert performan= ce with composite index

2010/11/2 hubert depesz lubaczewski <depesz@depesz.c= om>:
> On Mon, Nov 01, 2010 at 02:57:56PM +0100, C=E9dric Vill= emain wrote:
>> >   CONSTRAINT tableindex_pkey PRIMARY KEY= (tableindex)
>> > )
>> > the index definition is>> > CREATE INDEX "PK_AT2"
>> >   ON ABC
>= ;> >   USING btree
>> >   (event, tableindex)>> > TABLESPACE sample;
>>
>> Indexing twice t= he same column is useless. (perhaps move your PK to
>> the tablesp= ace 'sample' is good too ?)
>
> why do you say that?
> th= ese are not the same indexes and they serve different purposes.

Give= n that tableindex is the PK column, I really like to now the usage
patte= rn for having it indexed twice.

>
> Best regards,
>
> depesz
>
> --
> Linkedin: http://www.linke= din.com/in/depesz  /  blog: http://www.depesz.com/
> jid/gtalk: depesz@dep= esz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007
>

=

--
C=E9dric Villemain            =    2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expe= rtise, Formation et Support

--
Sent via pgsql-performance mailin= g list (pgsql-performance@postgresql.org)<= br>To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
=0A

=0A=0A --0-150225514-1288702267=:37613--