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 54684D1B587 for ; Wed, 8 Oct 2003 14:28:25 +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 62545-09 for ; Wed, 8 Oct 2003 11:27:43 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id D8A42D1B575 for ; Wed, 8 Oct 2003 11:27:37 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h98EWUJf012471 for ; Wed, 8 Oct 2003 20:02:30 +0530 Received: from persistent.co.in (daithan.intranet.pspl.co.in [192.168.7.161]) (authenticated bits=0) by persistent.co.in (8.12.9/8.12.9) with ESMTP id h98EWSNs012398; Wed, 8 Oct 2003 20:02:28 +0530 Message-ID: <3F841EDA.7000207@persistent.co.in> Date: Wed, 08 Oct 2003 19:57:38 +0530 From: Shridhar Daithankar Organization: Persistent Systems Pvt. Ltd. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030917 Thunderbird/0.3a X-Accept-Language: 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=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/202 X-Sequence-Number: 3950 Adrian Demaestri wrote: > 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. Use partido=99::int2 and partida=123::int4 Match the data types basically.. Shridhar