Re: Optimizer bug in UPDATE with subselect - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Optimizer bug in UPDATE with subselect
Date
Msg-id 24461.1043271986@sss.pgh.pa.us
Whole thread Raw
In response to Optimizer bug in UPDATE with subselect  ("Ace" <a_s@poczta.fm>)
List pgsql-bugs
"Ace" <a_s@poczta.fm> writes:
> I've upgraded my DB to 7.3.1 from 7.2. The following update causes the SEQ
> SCAN instead of INDEX SCAN (in 7.2 there was no bug like that):

I don't believe that.  No version of Postgres would have generated an
index scan on this query, because you've got a type mismatch: ident
is declared char(50) but the result of the trim()||trim() expression
will be of type text.

I'd recommend changing all the column datatypes from char(N) to text.
Then you could get rid of the trim() calls, and save yourself a bunch
of disk space too.  Those trailing spaces aren't free.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Lamar Owen
Date:
Subject: Re: Unable to Install PostGreSQL on Red Hat Linux release 7.2
Next
From: Hubert depesz Lubaczewski
Date:
Subject: misleading error message