Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 14A4C476823 for ; Thu, 4 Jul 2002 15:53:17 -0400 (EDT) Mailbox-Line: From pgman@candle.pha.pa.us Thu Jul 4 15:53:17 2002 Received: from candle.pha.pa.us (216-55-132-35.dsl.san-diego.abac.net [216.55.132.35]) by postgresql.org (Postfix) with ESMTP id 327564768F9 for ; Thu, 4 Jul 2002 15:47:32 -0400 (EDT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g64JlSM04801; Thu, 4 Jul 2002 15:47:28 -0400 (EDT) From: Bruce Momjian Message-Id: <200207041947.g64JlSM04801@candle.pha.pa.us> Subject: Re: Performance impact of record sizes In-Reply-To: <5.1.1.6.2.20020704115439.02202480@pop3.norton.antivirus> To: John Moore Date: Thu, 4 Jul 2002 15:47:28 -0400 (EDT) Cc: Postgresql Admin X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, hits=-3.4 required=5.0 tests=IN_REP_TO version=2.30 X-Spam-Level: X-Archive-Number: 200207/67 X-Sequence-Number: 4753 John Moore wrote: > We have a need to store text data which typically is just a hundred or so > bytes, but in some cases may extend to a few thousand. Our current field > has a varchar of 1024, which is not large enough. Key data is fixed sized > and much smaller in this same record. > > Our application is primarily transaction oriented, which means that records > will normally be fetched via random access, not sequential scans. > > The question is: what size thresholds exist? I assume that there is a > "page" size over which the record will be split into more than one. What is > that size, and does the spill cost any more or less than I had split the > record into two or more individual records in order to handle the same data? > > Obviously, the easiest thing for me to do is just set the varchar to > something big (say - 10K) but I don't want to do this without understanding > the OLTP performance impact. > If you don't want a limit, use TEXT. Long values are automatically stored in TOAST tables to avoid performance problems with sequential scans over long row values. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026