Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 34B7B476B84 for ; Fri, 16 Aug 2002 13:11:50 -0400 (EDT) Received: from joeconway.com (unknown [63.210.180.150]) by postgresql.org (Postfix) with ESMTP id 10461476B57 for ; Fri, 16 Aug 2002 13:07:42 -0400 (EDT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 3.5.9) with ESMTP-TLS id 1249993; Fri, 16 Aug 2002 09:56:20 -0700 Message-ID: <3D5D3121.30503@joeconway.com> Date: Fri, 16 Aug 2002 10:06:41 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David F. Skoll" Cc: pgsql-admin@postgresql.org Subject: Re: Large TEXT fields References: <20020816104435.09e41b35.dfs@roaringpenguin.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/196 X-Sequence-Number: 5311 David F. Skoll wrote: > I'm considering building a database with a table which stores entire > e-mail messages, up to around 128kB. > > - How does PostgreSQL cope with tables with huge amounts of data in a > TEXT column? Let's say 50,000 rows of e-mail messages with an average > e-mail size of 20kB, with maybe 5% of the messages over 100kB. What you describe is not what I would call huge, but a lot depends on your hardware and typical queries of course. Why don't you test it? As am example, I did this (on a Pentium 833, 512 MB RAM, IDE hard drive, Red Hat 7.3) 1. create table bigtest(f1 int, f2 text); 2. run script to insert 50000 rows of sequential id, and 130k string literal (took about 24 minutes) 3. create index bigtest_idx on bigtest(f1); (took about 2 seconds) 4. analyze bigtest; (took about 2 seconds) 5. explain analyze select f1, substr(f2,1,20) from bigtest where f1 = 33333; explain analyze select f1, substr(f2,1,20) from bigtest where f1 = 33333; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- Index Scan using bigtest_idx on bigtest (cost=0.00..3.01 rows=1 width=36) (actual time=1.66..1.69 rows=1 loops=1) Index Cond: (f1 = 33333) Total runtime: 1.83 msec (3 rows) HTH, Joe