Re: Optimization of this SQL sentence - Mailing list pgsql-performance

From Merlin Moncure
Subject Re: Optimization of this SQL sentence
Date
Msg-id b42b73150610181237r332d2f30ld48ff2b7f1f4d29@mail.gmail.com
Whole thread Raw
In response to Re: Optimization of this SQL sentence  ("Jim C. Nasby" <jim@nasby.net>)
List pgsql-performance
On 10/18/06, Jim C. Nasby <jim@nasby.net> wrote:
> On Tue, Oct 17, 2006 at 12:51:19PM -0400, Merlin Moncure wrote:
> > so, imo alexander is correct:
> > contacto varchar(255)
> >
> > ...is a false constraint, why exactly 255? is that were the dart landed?
>
> BTW, if we get variable-length varlena headers at some point, then
> setting certain limits might make sense to keep performance more
> consistent.

I would argue that it is assumptions about the underlying architecture
that got everyone into trouble in the first place :).  I would prefer
to treat length constraint as a constraint (n + 1 = error), unless
there was a *compelling* reason to do otherwise, which currently there
isn't (or hasn't been since we got toast)  a  lot of this stuff s due
to legacy thinking, a lot of dbf products had limts to varchar around
255 or so.

imo, a proper constraint system would apply everything at the domain
level, and minlength and maxlength would get equal weight, and be
optional for all types.

merlin

pgsql-performance by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Optimization of this SQL sentence (SOLVED)
Next
From: Ioana Danes
Date:
Subject: Postgresql 8.1.4 - performance issues for select on view using max