Re: bpchar, text and indexes

From: Victor Yegorov <vyegorov(at)gmail(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: bpchar, text and indexes
Date: 2016-02-22 16:09:50
Message-ID: CAGnEboikS7=hq64BmTrJqRBLx9R1CzWv6EY2RfppSoo9iHgOUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2016-02-22 18:00 GMT+02:00 Thomas Kellerer <spam_eater(at)gmx(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2016-02-22 16:20:45 Re: Why does query planner choose slower BitmapAnd ?
Previous Message Thomas Kellerer 2016-02-22 16:00:47 Re: bpchar, text and indexes