Re: How number of columns affects performance

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: PostgreSQL performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: How number of columns affects performance
Date: 2003-08-01 17:32:13
Message-ID: 1059759132.22384.5.camel@haggis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, 2003-08-01 at 12:14, Francisco J Reyes wrote:
> On Fri, 1 Aug 2003, Ron Johnson wrote:
>
> > Do all 100 fields *really* all refer to the same *one* entity,
> > with no repeating values, etc?
>
> Yes all fields belong to the same entity. I used 100 as an example it may
> be something like 60 to 80 fields (there are two tables in question). I
> don't formally do 3rd normal form, but for the most part I do most of
> the general concepts of normalization.

Woo hoo!!

> Yes some of the fields are varchars. 5 fields are varchar(22) and 3 longer
> (35, 58, 70). The total row length is a little over 400 characters in
> Foxpro. In postgreSQL may be less than 300 (ie Foxpro uses ASCII
> representation for numbers so to store "1234567" it uses 7 bytes, whereas
> in PostgreSQL I can just make it an int and use 4 bytes)

But I'd only split if these big field are rarely used. Note that
VARCHAR(xx) removes trailing spaces, so that also is a factor.

--
+-----------------------------------------------------------------+
| Ron Johnson, Jr. Home: ron(dot)l(dot)johnson(at)cox(dot)net |
| Jefferson, LA USA |
| |
| "I'm not a vegetarian because I love animals, I'm a vegetarian |
| because I hate vegetables!" |
| unknown |
+-----------------------------------------------------------------+

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2003-08-01 17:44:03 Re: How number of columns affects performance
Previous Message Francisco J Reyes 2003-08-01 17:26:47 Domains (Was [PERFORM] Views With Unions)