string casting for index usage

From: Michael Adler <adler(at)pobox(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: string casting for index usage
Date: 2004-03-18 18:52:37
Message-ID: 20040318185237.GA3568@pobox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


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.

Obviously there were many casting improvements made in 7.3, but our application doesn't exactly see it that way. Is explicit casting the only solution (other than schema modification)? I haven't found anything in the documentation on this subject.

Thanks,
Mike

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kurt Roeckx 2004-03-18 19:18:40 Re: [HACKERS] fsync method checking
Previous Message Bruce Momjian 2004-03-18 18:50:32 Re: [HACKERS] fsync method checking