Re: text field

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: Frank Bax <fbax(at)sympatico(dot)ca>, "Josh Berkus" <josh(at)agliodbs(dot)com>
Cc: Raphael Bauduin <raphael(at)be(dot)easynet(dot)net>, pgsql-novice(at)postgresql(dot)org
Subject: Re: text field
Date: 2002-01-30 16:45:50
Message-ID: web-680049@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Frank,

> >Otherwise, TEXT and VARCHAR perform the same in PostgreSQL.
>
> Almost the same? I read recently that VARCHAR(n) has a minor
> overhead on
> UPDATE to enforce the max length.

Hmmm ... yes, probably. I was comparing with SQL-Server, where large
text fields are stored as attached files and thus have vastly slower
performance than VARCHAR. I suppose that it would be an amusing
turnabout if, thanks to TOAST, TEXT was marginally faster than VARCHAR
for INSERT & UPDATE in Postgres.

Warning, though; despite TOAST, you will still see a significant
degradation is database performance with very large text fields if
your machine has limited disk access (such as an IDE drive).
Basically, if the size of your text file exceeds the buffer size
you've set in postgresql.conf (default is 8k I think) then you'll see
queries slow down 10-fold as the database engine shuttles your data to
and from the swap files on disk. You can fix this by increasing the
buffer (which may require buying more memory for the computer!) and/or
adding more/faster disks to the computer.

-Josh

______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Torbj=?ISO-8859-1?B?9g==?=rn Andersson 2002-01-30 16:47:38 Re: Function Problem
Previous Message Tom Lane 2002-01-30 16:00:15 Re: 16k query limit