X-Original-To: pgsql-performance@postgresql.org Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id 6934B475CE5 for ; Wed, 5 Mar 2003 14:00:44 -0500 (EST) Received: from [216.135.165.74] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 4.0.2) with HTTP id 2881474; Wed, 05 Mar 2003 11:00:23 -0800 From: "Josh Berkus" Subject: Re: Planner matching constants across tables in a To: Richard Huxton , Greg Stark Cc: Greg Stark , X-Mailer: CommuniGate Pro Web Mailer v.4.0.2 Date: Wed, 05 Mar 2003 11:00:23 -0800 Message-ID: In-Reply-To: <200303051612.09558.dev@archonet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200303/32 X-Sequence-Number: 1330 Richard, > A domain defined as varchar() actually - which is why it's not using > an index, > but that's neither here nor there regarding the constant issue. You might improve your performance overall if you cast the constant to tel_num before doing the comparison in the query. Right now, the parser is casting the whole column to text instead, because it can't tell that the constant you supply is a valid tel_num. -Josh