Re: Prefix compression of B-Tree keys

Поиск
Список
Период
Сортировка
От Claudio Freire
Тема Re: Prefix compression of B-Tree keys
Дата
Msg-id CAGTBQpb5AjV4E7=jLdo9ziSZ6aw6H0fxHe-i=6yaT_Uc-P47qA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Prefix compression of B-Tree keys  (Peter Geoghegan <pg@heroku.com>)
Список pgsql-hackers
On Fri, Jan 31, 2014 at 3:51 AM, Peter Geoghegan <pg@heroku.com> wrote:
>> Now, I haven't checked if it's already done. Sorry if it is. I did
>> mock around btree code a lot and don't remember any of this, but I do
>> remember stuff that could be used to achieve it (specifically, all the
>> index-only-scan machinery, which allows for implicit info).
>
> I think it would make sense to do it on leaf pages, where there is
> frequently a lot of redundancy. The reason that I myself wouldn't do
> it first is that offhand I think that it'd be harder to come up with a
> very generic infrastructure to make it work across diverse types, and
> it isn't that useful where there isn't much redundancy in prefixes.
> The B-Tree code doesn't really know anything about the type indexed,
> and that's a useful property. But it's still definitely a useful goal.

Well, for multi-column it should be really simple. You already have
all the necessary information to decide on the prefix (the common
prefix columns of leftmost and rightmost keys). It's harder for text
columns, since you must abstract out the "common prefix check","append
prefix", and "remove prefix" operations. That would probably require
extending opclasses.



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: pgindent wishlist item
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: pgindent wishlist item