Re: TOAST usage setting

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: TOAST usage setting
Дата
Msg-id 87abvno8yg.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: TOAST usage setting  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: TOAST usage setting  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
"Bruce Momjian" <bruce@momjian.us> writes:

>> No, we did substring() too :)
>
> Uh, I looked at text_substring(), and while there is an optimization to
> do character counting for encoding length == 1, it is still accessing
> the data.

Sure but it'll only access the first chunk. There are two chunks in your test.
It might be interesting to run tests accessing 0 (length()), 1 (substr()), and
2 chunks (hashtext()).

Or if you're concerned with the cpu cost of hashtext you could calculate the
precise two bytes you need to access with substr to force it to load both
chunks. But I think the real cost of unnecessary toasting is the random disk
i/o so the cpu cost is of secondary interest.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: TOAST usage setting
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: TOAST usage setting