Re: VARDATA_COMPRESSED_GET_COMPRESS_METHOD comment?

Поиск
Список
Период
Сортировка
От Christoph Berg
Тема Re: VARDATA_COMPRESSED_GET_COMPRESS_METHOD comment?
Дата
Msg-id YTjXwhKH/4J6U48u@msg.df7cb.de
обсуждение исходный текст
Ответ на Re: VARDATA_COMPRESSED_GET_COMPRESS_METHOD comment?  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: VARDATA_COMPRESSED_GET_COMPRESS_METHOD comment?  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Re: Robert Haas
> But I agree with you that referring to the argument to
> VARDATA_COMPRESSED_GET_EXTSIZE or
> VARDATA_COMPRESSED_GET_COMPRESS_METHOD as an "external compressed
> Datum" doesn't seem quite right. It is compressed, but it is not
> external, at least in the sense that I understand that term.

How about "compressed-in-line Datum" like on the comment 5 lines above?

/* caution: this will not work on an external or compressed-in-line Datum */
/* caution: this will return a possibly unaligned pointer */
#define VARDATA_ANY(PTR) \
     (VARATT_IS_1B(PTR) ? VARDATA_1B(PTR) : VARDATA_4B(PTR))

/* Decompressed size and compression method of an external compressed Datum */
#define VARDATA_COMPRESSED_GET_EXTSIZE(PTR) \
    (((varattrib_4b *) (PTR))->va_compressed.va_tcinfo & VARLENA_EXTSIZE_MASK)
#define VARDATA_COMPRESSED_GET_COMPRESS_METHOD(PTR) \
    (((varattrib_4b *) (PTR))->va_compressed.va_tcinfo >> VARLENA_EXTSIZE_BITS)

This "external" there cost me about one hour of extra poking around
until I realized this is actually the macro I wanted.

-> /* Decompressed size and compression method of a compressed-in-line Datum */

Christoph



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: The Free Space Map: Problems and Opportunities
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Fix erroneous parallel execution when modifying CTE is present in rewritten query