Re: join by char(16) or by bytea?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: join by char(16) or by bytea?
Дата
Msg-id 10231.1176150826@sss.pgh.pa.us
обсуждение исходный текст
Ответ на join by char(16) or by bytea?  ("Sergei Shelukhin" <realgeek@gmail.com>)
Список pgsql-general
"Sergei Shelukhin" <realgeek@gmail.com> writes:
> Due to limitations of both pg and php I gave up on the attempts to
> make bigint keys work;

Which limitations would those be?

> I have a choice between 16-byte character
> strings or "8-byte" bytea (decode(string_from_above, "hex")) for an
> index column for a table.
> Which one will be faster for exact matches and joins?

bytea, likely, especially if you are using a non-C locale.  In C locale
the charstring comparisons would degenerate to memcmp and probably not
be measurably different from bytea, but in other locales strcoll is
used and that can be pretty slow.  OTOH, the pain-in-the-neck factor
for using decode in all your queries seems pretty bad, so I'm really
wondering what problem you've got with bigint.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problem with copying data
Следующее
От: Tom Lane
Дата:
Сообщение: Re: NEWBIE: How do I get the oldest date contained in 3 tables