Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id BB88F650EBF for ; Tue, 1 Jul 2008 12:34:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 81037-09-2 for ; Tue, 1 Jul 2008 12:34:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fhw-relay07.plus.net (fhw-relay07.plus.net [212.159.14.215]) by postgresql.org (Postfix) with ESMTP id 62E49650E83 for ; Tue, 1 Jul 2008 12:34:00 -0300 (ADT) Received: from [84.51.143.99] (helo=server3.office.archonet.com) by fhw-relay07.plus.net with esmtp (Exim) id 1KDhre-0008I6-Nc; Tue, 01 Jul 2008 16:33:55 +0100 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 7E63327404A; Tue, 1 Jul 2008 16:33:54 +0100 (BST) Message-ID: <486A4E62.40502@archonet.com> Date: Tue, 01 Jul 2008 16:33:54 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Franck Routier CC: pgsql-performance@postgresql.org Subject: Re: Does max size of varchar influence index size References: <1214845078.6710.7.camel@franck-laptop> <1214857494.6049.76.camel@localhost> <1214924736.668.22.camel@franck-laptop> In-Reply-To: <1214924736.668.22.camel@franck-laptop> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Plusnet-Relay: 93313316e52e54742a55314618e0554e X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/8 X-Sequence-Number: 30608 Franck Routier wrote: > Le lundi 30 juin 2008 =C3=A0 13:24 -0700, Mark Roberts a =C3=A9crit : >=20 > Hi Mark, >=20 >> Is there any particular reason that you're not using a surrogate key? >=20 > Well, human readability is the main reason, no standard way to handle > sequences between databases vendors being the second... (and also > problems when copying data between different instances of the database)= . >=20 > So surrogate keys could be a way, and I am considering this, but I'd > rather avoid it :) Might be worth looking at 8.3 - that can save you significant space with=20 short varchar's - the field-length is no longer fixed at 32 bits but can=20 adjust itself automatically. Apart from the overheads, you need the=20 space to store the text in each string, not the maximum possible. --=20 Richard Huxton Archonet Ltd