Обсуждение: char array overhead

Поиск
Список
Период
Сортировка

char array overhead

От
Rob Sargent
Дата:
I'm angling toward using a very wide char(1) array.  Is the one-byte overhead for char(n<126) applied to each element or to the array?

Re: char array overhead

От
Steve Atkins
Дата:
On Mar 31, 2014, at 8:08 AM, Rob Sargent <robjsargent@gmail.com> wrote:

> I'm angling toward using a very wide char(1) array.  Is the one-byte overhead for char(n<126) applied to each element
orto the array? 

Each element, it's a variable length type.

There's probably a better way of storing your data, but if you end up really needing a one-byte long character type,
thereis "char" (with the quotes). 

Cheers,
  Steve



Re: char array overhead

От
Rob Sargent
Дата:
On 03/31/2014 09:48 AM, Steve Atkins wrote:
On Mar 31, 2014, at 8:08 AM, Rob Sargent <robjsargent@gmail.com> wrote:

I'm angling toward using a very wide char(1) array.  Is the one-byte overhead for char(n<126) applied to each element or to the array?
Each element, it's a variable length type.

There's probably a better way of storing your data, but if you end up really needing a one-byte long character type, there is "char" (with the quotes).

Cheers, Steve



Thank you! First for the confirmation on the overhead (how disappointing) and secondly for the "char".  That had not crossed my radar.

Jsyk, I'm toying with a rather large number of small valued datapoints per sample.  I'm tying text and smallint as well.

Thanks again,

rjs

Re: char array overhead

От
Alvaro Herrera
Дата:
Rob Sargent wrote:

> Jsyk, I'm toying with a rather large number of small valued
> datapoints per sample.  I'm tying text and smallint as well.

You could try "char"[] ...

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services