From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Adler <adler@pobox.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: string casting for index usage
Date: Thu, 18 Mar 2004 15:39:12 -0500
Message-ID: <12025.1079642352@sss.pgh.pa.us> (raw)
In-Reply-To: <20040318185237.GA3568@pobox.com>
References: <20040318185237.GA3568@pobox.com>
Michael Adler <adler@pobox.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, adler@pobox.com
Subject: Re: string casting for index usage
In-Reply-To: <12025.1079642352@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox