pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Adler <adler@pobox.com>
To: pgsql-performance@postgresql.org
Subject: string casting for index usage
Date: Thu, 18 Mar 2004 13:52:37 -0500
Message-ID: <20040318185237.GA3568@pobox.com> (raw)


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



view thread (4+ messages)  latest in thread

Message-ID: <20040318185237.GA3568@pobox.com>
Permalink:  ../20040318185237.GA3568@pobox.com/
Also on:    postgresql.org/message-id/20040318185237.GA3568@pobox.com

 · 

reply

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: adler@pobox.com
  Subject: Re: string casting for index usage
  In-Reply-To: <20040318185237.GA3568@pobox.com>

* 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