pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alex Turner <armtuk@gmail.com>
To: Loren M. Lang <lorenl@alzatex.com>
To: PostgreSQL Perfomance <pgsql-performance@postgresql.org>
Subject: Re: TEXT field and Postgresql Perfomance
Date: Sat, 8 Jan 2005 00:02:54 -0500
Message-ID: <33c6269f0501072102144e82dc@mail.gmail.com> (raw)
In-Reply-To: <20050108040323.GA13889@wolff.to>
References: <20050108033647.GB2867@alzatex.com>
	<20050108040323.GA13889@wolff.to>

I guess my question that would follow is, when does it work best to
start using BLOBs/CLOBs (I forget if pg has CLOBs) instead of
textfields because your table is going to balloon in disk blocks if
you have large amounts of data, and all fields you want to search on
would have to be indexed, increasing insert time substantialy.

Does it ever pay to use text and not CLOB unless your text is going to
be short, in which case why not just varchar, leading to the thought
that the text datatype is just bad?

Alex Turner
NetEconomist


On Fri, 7 Jan 2005 22:03:23 -0600, Bruno Wolff III <bruno@wolff.to> wrote:
> On Fri, Jan 07, 2005 at 19:36:47 -0800,
>   "Loren M. Lang" <lorenl@alzatex.com> wrote:
> > Do large TEXT or VARCHAR entries in postgresql cause any performance
> > degradation when a query is being executed to search for data in a table
> > where the TEXT/VARCHAR fields aren't being searched themselves?
> 
> Yes in that the data is more spread out because of the wider rows and that
> results in more disk blocks being looked at to get the desired data.
> 
> > Since, according to the postgresql docs, theirs no performance
> > difference between VARCHAR and TEXT, I'm assuming VARCHAR is identical
> > to TEXT entries with a restriction set on the length.  And since TEXT
> > can be of any possible size, then they must be stored independently of
> 
> No.
> 
> > the rest of the table which is probably all stored in a fixed size rows
> 
> No, Postgres uses variable length records.
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>



view thread (5+ messages)  latest in thread

Message-ID: <33c6269f0501072102144e82dc@mail.gmail.com>
Permalink:  ../33c6269f0501072102144e82dc@mail.gmail.com/
Also on:    postgresql.org/message-id/33c6269f0501072102144e82dc@mail.gmail.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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: armtuk@gmail.com, lorenl@alzatex.com
  Subject: Re: TEXT field and Postgresql Perfomance
  In-Reply-To: <33c6269f0501072102144e82dc@mail.gmail.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