Re: bpchar, text and indexes

Поиск
Список
Период
Сортировка
От Victor Yegorov
Тема Re: bpchar, text and indexes
Дата
Msg-id CAGnEboikS7=hq64BmTrJqRBLx9R1CzWv6EY2RfppSoo9iHgOUQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: bpchar, text and indexes  (Thomas Kellerer <spam_eater@gmx.net>)
Ответы Re: bpchar, text and indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: bpchar, text and indexes
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Why does query planner choose slower BitmapAnd ?