On Fri, 04 Apr 2003 09:13:54 -0500, Jason Hihn
<jhihn@paytimepayroll.com> wrote:
>> All char(n) types are stored on 4 byte boundaries, so char(1) costs up
>> to 8 bytes.
>
>Is this true for memory AND disk, or just memory?
Both.
>> Instead of char(1) you can use the Postgres specific type "char"
>> (*with* the quotes) which only needs one byte.
>
>So I assume use of this is 'safe'? Any degridation on performance?
I don't expect performance degradation; this should rather improve
performance because with smaller tuples you get more tuples per page
and so pages have to be read/written less frequently. AFAICT from my
tests, if your system is IO bound, then a reduction of tuple size
translates directly to performance improvement, e.g. 5% tuple size
reduction results more or less in 5% better throughput; might be
less, if your usage pattern is CPU bound; might be more, if you're
lucky and your working set jumps from just a bit more than available
cache to just a bit less.
Servus
Manfred