Skip site navigation (1) Skip section navigation (2)

Re: string casting for index usage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Adler <adler(at)pobox(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: string casting for index usage
Date: 2004-03-18 20:39:12
Message-ID: 12025.1079642352@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Michael Adler <adler(at)pobox(dot)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

In response to

Responses

pgsql-performance by date

Next:From: Josh BerkusDate: 2004-03-18 20:39:58
Subject: Re: [HACKERS] fsync method checking
Previous:From: Bruce MomjianDate: 2004-03-18 20:34:21
Subject: Re: [HACKERS] fsync method checking

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group