From: Matt Mello <alien@spaceship.com>
To: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: 1 char in the world
Date: Wed, 29 Jan 2003 17:29:58 -0600
Message-ID: <3E3863F6.2020004@spaceship.com> (raw)
In-Reply-To: <1043842700.5008.11.camel@huli>
References: <3E37733D.90205@spaceship.com>
<1043842700.5008.11.camel@huli>
> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: alien@spaceship.com
Subject: Re: 1 char in the world
In-Reply-To: <3E3863F6.2020004@spaceship.com>
References: <3E37733D.90205@spaceship.com> <1043842700.5008.11.camel@huli> <3E3863F6.2020004@spaceship.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox