Re: 1 char in the world

From: Matt Mello <alien(at)spaceship(dot)com>
To: pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: 1 char in the world
Date: 2003-01-29 23:29:58
Message-ID: 3E3863F6.2020004@spaceship.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2003-01-29 23:59:26 Re: 1 char in the world
Previous Message John Lange 2003-01-29 18:29:00 Re: Query plan and Inheritance. Weird behavior