X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 38F0ED1D2A0 for ; Thu, 18 Mar 2004 20:39:12 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 10148-04 for ; Thu, 18 Mar 2004 16:39:13 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 83CA4D1CCD6 for ; Thu, 18 Mar 2004 16:39:07 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i2IKdC2e012026; Thu, 18 Mar 2004 15:39:12 -0500 (EST) To: Michael Adler Cc: pgsql-performance@postgresql.org Subject: Re: string casting for index usage In-reply-to: <20040318185237.GA3568@pobox.com> References: <20040318185237.GA3568@pobox.com> Comments: In-reply-to Michael Adler message dated "Thu, 18 Mar 2004 13:52:37 -0500" Date: Thu, 18 Mar 2004 15:39:12 -0500 Message-ID: <12025.1079642352@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/268 X-Sequence-Number: 6124 Michael Adler writes: > In porting an application from v7.2 and v7.3, I noticed that a join on a varchar column and a text column was ignoring indices that were helpful in v7.2. When I explicitly cast the text to a varchar (or set ENABLE_SEQSCAN TO false) the index is scanned and it works as efficiently as in v7.2. Maybe you should be moving to 7.4, instead. A desultory test didn't show any difference between 7.2.4 and 7.3.6 in this respect, however. Perhaps you forgot to ANALYZE yet in the new database? regards, tom lane