From: Merlin Moncure <mmoncure@gmail.com>
To: Jim C. Nasby <jim@nasby.net>
Cc: Mario Weilguni <mweilguni@sime.com>
Cc: pgsql-performance@postgresql.org, "Alexander Staubo" <alex@purefiction.net>
Cc: Ruben Rubio <ruben@rentalia.com>
Subject: Re: Optimization of this SQL sentence
Date: Wed, 18 Oct 2006 15:37:07 -0400
Message-ID: <b42b73150610181237r332d2f30ld48ff2b7f1f4d29@mail.gmail.com> (raw)
In-Reply-To: <20061018191734.GN85041@nasby.net>
References: <45349CDF.3090002@rentalia.com>
<4534A35E.9030909@rentalia.com>
<181E6D21-8326-4ED6-A9AE-6F9917C1C319@purefiction.net>
<200610171729.19596.mweilguni@sime.com>
<b42b73150610170951t33619da0u4851de1fbb1c0b0f@mail.gmail.com>
<20061018191734.GN85041@nasby.net>
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
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: mmoncure@gmail.com, jim@nasby.net, mweilguni@sime.com, alex@purefiction.net, ruben@rentalia.com
Subject: Re: Optimization of this SQL sentence
In-Reply-To: <b42b73150610181237r332d2f30ld48ff2b7f1f4d29@mail.gmail.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