Re: 1 char in the world

Поиск
Список
Период
Сортировка
От Matt Mello
Тема Re: 1 char in the world
Дата
Msg-id 3E3863F6.2020004@spaceship.com
обсуждение исходный текст
Ответ на Re: 1 char in the world  (Hannu Krosing <hannu@tm.ee>)
Ответы Re: 1 char in the world
Список pgsql-performance
> OTOH the actual storage of one-char datatype should not play so
> significant role for very large tables, even if this is the only field
> in that table, as most of the overhead will be in other places - storage
> overhead in page/tuple headers, performance in retrieving the
> pages/tuples and cache lookups, etc.

Is that true if I have a table that consists of lots of 1-char fields?
For example, if I have a table with 4 billion records, which consist of
(20) 1-char fields each, then the storage for the data will be something
like 5 times as large if I use TEXT than if I use "char".

> Also, for very big tables you will most likely want to restrict selects
> on other criteria than a 4-valued field, so that indexes could be used
> in retrieving data.

I do.  I was just using that query for this test only.  I have some very
complex queries that are constrained by many foriegn-key int4 fields,
but also a few of these 1-char fields.

> You could also try just
>
> select count(*) from table where bool;
>

I will do this in a while and report to the list.  I am going to try
make a reproducable test that anyone can do, to be sure my results are
"real".

> Did you repeat the texts enough times to be sure that you get reliable
> results ?

I think so.  Not so much as hundreds of times, though.


--
Matt Mello
512-350-6900


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

Предыдущее
От: John Lange
Дата:
Сообщение: Re: Query plan and Inheritance. Weird behavior
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 1 char in the world