X-Original-To: pgsql-performance@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id EB081476245 for ; Tue, 4 Mar 2003 12:20:44 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 40606-07 for ; Tue, 4 Mar 2003 12:20:33 -0500 (EST) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id 0E542476243 for ; Tue, 4 Mar 2003 12:20:33 -0500 (EST) Received: from klaster.net (pa160.krakow.cvx.ppp.tpnet.pl [213.76.36.160]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 41A892B88F; Tue, 4 Mar 2003 18:18:52 +0100 (CET) Message-ID: <3E64E079.8050807@klaster.net> Date: Tue, 04 Mar 2003 18:20:57 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; PL; rv:1.1) Gecko/20020826 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Andreas Pflug Cc: pgsql-performance@postgresql.org Subject: Re: Slow query performance on large table References: <000001c2e25c$ad506170$0c64a8c0@paulspc> <23081.1046790781@sss.pgh.pa.us> <3E64D694.9050309@web.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Archive-Number: 200303/15 X-Sequence-Number: 1313 Andreas Pflug wrote: > Tom, > > does this mean that a primary key alone might not be enough? As far as I > understood Paul, the PK looks quite as the newly created index does, so > "create index ind_meas on measurement (assessment,time)" should perform > the same as "... primary key(assessment,time)". > Do possibly non-optimal indices (only assessment, only time as Paul > described earlier) screw up the optimizer, igoring the better option > usiing the PK? Obviously, the index used should be combined of > (assessment,time) but IMHO a PK should be enough. > > regards, > > Andreas You are right - primary key should be ok, but Paul lost it. psql \d shows primary key indexes, but in this case there was no such primary key. Regards, Tomasz Myrta