Re: Fixed width rows faster? - Mailing list pgsql-performance

From Tom Lane
Subject Re: Fixed width rows faster?
Date
Msg-id 14231.1078551739@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fixed width rows faster?  (Mike Nolan <nolan@gw.tssi.com>)
Responses Re: Fixed width rows faster?
List pgsql-performance
Mike Nolan <nolan@gw.tssi.com> writes:
>> Frankly, the only reason to use anything other than TEXT is
>> compatibility with other databases and applications.

> You don't consider a requirement that a field be no longer than a
> certain length a reason not to use TEXT?

If you have an actual business-logic requirement to restrict a field to
no more than N characters, then by all means use varchar(N); that's
what it's for.  But I agree with what I think Josh meant: there is very
seldom any non-broken reason to have a hard upper limit on string
lengths.  If you think you need varchar(N) you should stop and ask
why exactly.  If you cannot give a specific, coherent reason why the
particular value of N that you're using is the One True Length for the
field, then you really need to think twice.

            regards, tom lane

pgsql-performance by date:

Previous
From: Mike Nolan
Date:
Subject: Re: Fixed width rows faster?
Next
From: Tom Lane
Date:
Subject: Re: Fixed width rows faster?