Re: Datatypes and performance

From: Andrew Sullivan <andrew(at)libertyrms(dot)info>
To: PostgreSQL List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Datatypes and performance
Date: 2003-07-08 04:33:15
Message-ID: 20030708043315.GB11964@libertyrms.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jul 04, 2003 at 02:22:39PM -0700, Maksim Likharev wrote:
> Ok, what I see here tells me that text is slower then fixed len varchar,
> due to stored in separate table ( but how else you can store long fields
> ).

No, sorry, I think I was unclear. varchar() is the same thing as
text(); they'll be the same assuming the same length.

If you go over the length for TOAST (1k? 2k? It's in the docs, I
think, but I can't recall where) then you'll get it TOASTed. But
that's true for most (all? I seem to recall so -- I don't have my
local copy of the docs here) datatypes. One way to avoid running
over that is to use varchar(n), for some small-enough value of n.
But then you pay with overhead on every insert, because you have to
check the length.

A

--
----
Andrew Sullivan 204-4141 Yonge Street
Liberty RMS Toronto, Ontario Canada
<andrew(at)libertyrms(dot)info> M2P 2A8
+1 416 646 3304 x110

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2003-07-08 04:55:08 Re: System advices
Previous Message Maksim Likharev 2003-07-08 02:19:11 Re: PG crash on simple query, story continues