Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 1A0DE9FB3A1 for ; Sat, 16 Jun 2007 12:07:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 48149-08 for ; Sat, 16 Jun 2007 12:07:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 9FC2B9FB38A for ; Sat, 16 Jun 2007 12:07:10 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l5GF78tH011150; Sat, 16 Jun 2007 11:07:08 -0400 (EDT) To: okparanoid@free.fr cc: pgsql-performance@postgresql.org Subject: Re: determining maxsize for character varying In-reply-to: <1181987590.4673b306d4baf@imp.free.fr> References: <1181987590.4673b306d4baf@imp.free.fr> Comments: In-reply-to okparanoid@free.fr message dated "Sat, 16 Jun 2007 11:53:10 +0200" Date: Sat, 16 Jun 2007 11:07:08 -0400 Message-ID: <11149.1182006428@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/286 X-Sequence-Number: 25319 okparanoid@free.fr writes: > Hello i would like to know if not determining a max size value for a > character varying's fields decrease the perfomance (perhaps size of > stockage ? No, more the other way around: specifying varchar(N) when you had to pick N out of the air decreases performance, because of all the essentially useless checks of the string length that Postgres has to make. If you cannot defend a specific limit N as being required by your application, then just make it unconstrained varchar (or better text). Do *not* use char(N) for data with highly variable width; that one definitely will cost you performance and disk space. regards, tom lane