Re: bpchar, text and indexes - Mailing list pgsql-general

From Victor Yegorov
Subject Re: bpchar, text and indexes
Date
Msg-id CAGnEboikS7=hq64BmTrJqRBLx9R1CzWv6EY2RfppSoo9iHgOUQ@mail.gmail.com
Whole thread Raw
In response to Re: bpchar, text and indexes  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: bpchar, text and indexes
List pgsql-general
2016-02-22 18:00 GMT+02:00 Thomas Kellerer <spam_eater@gmx.net>:
I assume that this has to do with the fact that char(n) is blank padded to 20 character.

Yes, this was my thought too, but I do not understand what is going on in details.


To be able to correctly compare that to a text value, sn_c has to be casted to text and then the index (which contains blank padded values) can not be used any more.

Well, for `varchar` type Postgres is able to do `varchar` -> `bpchar` cast for my constant. I do not understand why for `text` it cannot and casts column instead.


--
Victor Y. Yegorov

pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: bpchar, text and indexes
Next
From: Stephen Frost
Date:
Subject: Re: Why does query planner choose slower BitmapAnd ?