X-Original-To: pgsql-admin@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 3DCEF925624 for ; Sun, 25 May 2003 00:12:26 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 35760-01 for ; Sun, 25 May 2003 00:12:25 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by developer.postgresql.org (Postfix) with ESMTP id DF6CD92561F for ; Sun, 25 May 2003 00:12:24 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h4P4CCU6003277; Sun, 25 May 2003 00:12:13 -0400 (EDT) To: Robert.Farrugia@go.com.mt Cc: pgsql-admin@postgresql.org Subject: Re: After VACUUM, statistics become skewed In-reply-to: <20030523093733.0F9AC924DF1@developer.postgresql.org> References: <20030523093733.0F9AC924DF1@developer.postgresql.org> Comments: In-reply-to Robert.Farrugia@go.com.mt message dated "Fri, 23 May 2003 11:37:30 +0200" Date: Sun, 25 May 2003 00:12:12 -0400 Message-ID: <3276.1053835932@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/353 X-Sequence-Number: 8915 Robert.Farrugia@go.com.mt writes: > Running a slightly modified query i.e. removing the in and using an > equality, the planner uses the "correct" index this time. Hm. What were the definitions of the two indexes, exactly? There is an asymmetry in the planner's handling of AND/OR clauses that can cause it to fail to recognize that a multicolumn index is usable, depending on whether the OR clause (the IN part of your query) applies to the first index column or a later one. I'm not sure if this relates to your problem or not, though... regards, tom lane