pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: David F. Skoll <dfs@roaringpenguin.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Large TEXT fields
Date: Fri, 16 Aug 2002 10:06:41 -0700
Message-ID: <3D5D3121.30503@joeconway.com> (raw)
References: <20020816104435.09e41b35.dfs@roaringpenguin.com>

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




view thread (2+ messages)

Message-ID: <3D5D3121.30503@joeconway.com>
Permalink:  ../3D5D3121.30503@joeconway.com/
Also on:    postgresql.org/message-id/3D5D3121.30503@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mail@joeconway.com, dfs@roaringpenguin.com
  Subject: Re: Large TEXT fields
  In-Reply-To: <3D5D3121.30503@joeconway.com>
  References: <20020816104435.09e41b35.dfs@roaringpenguin.com> <3D5D3121.30503@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox