Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id C7C619FB5B2 for ; Tue, 17 Oct 2006 13:30:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 67037-05-2 for ; Tue, 17 Oct 2006 16:29:54 +0000 (UTC) X-Greylist: delayed 00:24:46.975005 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id C05E19FBC0B for ; Tue, 17 Oct 2006 12:54:11 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from relay.icomedias.com (relay.icomedias.com [62.99.232.66]) by svr4.postgresql.org (Postfix) with ESMTP id 721855AF8DE for ; Tue, 17 Oct 2006 15:29:23 +0000 (GMT) Received: from loki.icomedias.com ([10.192.17.128]) by relay.icomedias.com (8.13.6/8.13.6) with ESMTP id k9HFTJ1Y028572; Tue, 17 Oct 2006 17:29:20 +0200 From: Mario Weilguni To: pgsql-performance@postgresql.org Subject: Re: Optimization of this SQL sentence Date: Tue, 17 Oct 2006 17:29:19 +0200 User-Agent: KMail/1.9.4 Cc: Alexander Staubo , Ruben Rubio References: <45349CDF.3090002@rentalia.com> <4534A35E.9030909@rentalia.com> <181E6D21-8326-4ED6-A9AE-6F9917C1C319@purefiction.net> In-Reply-To: <181E6D21-8326-4ED6-A9AE-6F9917C1C319@purefiction.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200610171729.19596.mweilguni@sime.com> X-Scanned-By: MIMEDefang 2.54 on 10.192.64.200 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.384 tagged_above=0 required=5 tests=SPF_SOFTFAIL X-Spam-Level: * X-Archive-Number: 200610/326 X-Sequence-Number: 21455 Am Dienstag, 17. Oktober 2006 11:52 schrieb Alexander Staubo: > Lastly, note that in PostgreSQL these length declarations are not =C2=A0 > necessary: > > =C2=A0 =C2=A0contacto varchar(255), > =C2=A0 =C2=A0fuente varchar(512), > =C2=A0 =C2=A0prefijopais varchar(10) > > Instead, use: > > =C2=A0 =C2=A0contacto text, > =C2=A0 =C2=A0fuente text, > =C2=A0 =C2=A0prefijopais text > > See the PostgreSQL manual for an explanation of varchar vs. text. Enforcing length constraints with varchar(xyz) is good database design, not= a=20 bad one. Using text everywhere might be tempting because it works, but it's= =20 not a good idea.