X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 01478D1B517 for ; Wed, 8 Oct 2003 14:19:45 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 71438-01 for ; Wed, 8 Oct 2003 11:18:58 -0300 (ADT) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by svr1.postgresql.org (Postfix) with ESMTP id 33716D1B577 for ; Wed, 8 Oct 2003 11:18:54 -0300 (ADT) Received: from klaster.net (core-1.citynet.pl [80.48.135.69]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 04A232B3CB; Wed, 8 Oct 2003 16:18:08 +0200 (CEST) Message-ID: <3F841CAF.6070202@klaster.net> Date: Wed, 08 Oct 2003 16:18:23 +0200 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; pl-PL; rv:1.5) Gecko/20030916 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Adrian Demaestri Cc: pgsql-performance@postgresql.org Subject: Re: planner doesn't use multicolumn index References: <20031008140859.21016.qmail@web10510.mail.yahoo.com> In-Reply-To: <20031008140859.21016.qmail@web10510.mail.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/201 X-Sequence-Number: 3949 > We've a table with about 8 million rows, and we need to get rows by the > value of two of its fields( the type of the fields are int2 and int4, > the where condition is v.g. partido=99 and partida=123). We created a > multicolumn index on that fields but the planner doesn't use it, it > still use a seqscan. That fields are primary key of the table and we > clusterded the table based on that index, but it still doesn't work. We > also set the enviroment variable enable_seqscan to false and nathing > happends. The only way the planner use it is in querys that order by the > expression of the index. > Any idea? > thanks. > Adrián where partido=99::int2 and partida=123; Regards, Tomasz Myrta