Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 4F95F9FB2CC for ; Wed, 18 Oct 2006 16:37:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 01803-05 for ; Wed, 18 Oct 2006 16:37:09 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by postgresql.org (Postfix) with ESMTP id 5C8EF9FB2D2 for ; Wed, 18 Oct 2006 16:37:08 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id 30so246144ugc for ; Wed, 18 Oct 2006 12:37:07 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ETgM61LulTlT0Z+XuvBE6iGcMSL6qzM5aPbZzVlPS+xR0mu2/IA+rQytVv1x5doG/kH/67pmx/vxXVvTzPP+tfqR0Q50RHu43cqBJwHMeqZx/aImhNcyntUeLj/1dTMTHbTJ9V74ESRqaKDUSQ7ydlURvNfZcfXFcSmRt4QndiA= Received: by 10.78.128.15 with SMTP id a15mr10575716hud; Wed, 18 Oct 2006 12:37:07 -0700 (PDT) Received: by 10.78.35.18 with HTTP; Wed, 18 Oct 2006 12:37:07 -0700 (PDT) Message-ID: Date: Wed, 18 Oct 2006 15:37:07 -0400 From: "Merlin Moncure" To: "Jim C. Nasby" Subject: Re: Optimization of this SQL sentence Cc: "Mario Weilguni" , pgsql-performance@postgresql.org, "Alexander Staubo" , "Ruben Rubio" In-Reply-To: <20061018191734.GN85041@nasby.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <45349CDF.3090002@rentalia.com> <4534A35E.9030909@rentalia.com> <181E6D21-8326-4ED6-A9AE-6F9917C1C319@purefiction.net> <200610171729.19596.mweilguni@sime.com> <20061018191734.GN85041@nasby.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.219 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/368 X-Sequence-Number: 21497 On 10/18/06, Jim C. Nasby 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