Re: Text/Varchar performance...

From: "Steinar H(dot) Gunderson" <sgunderson(at)bigfoot(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Text/Varchar performance...
Date: 2005-10-10 12:54:22
Message-ID: 20051010125422.GA7454@uio.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

On Mon, Oct 10, 2005 at 06:28:23PM +0700, Ahmad Fajar wrote:
> than you can index the field and you can gain better
> perfomance in searching base on the fields, because the search uses the
> index you have been created.

That really depends on the queries. An index will help some queries (notably
<, = or > comparisons, or LIKE 'foo%' with the C locale), but definitely not
all (it will help you nothing for LIKE '%foo%').

> If you do not need to index the field, you can use the text field. Because
> text field can store data up to 4 Gbytes.

So can varchar.

/* Steinar */
--
Homepage: http://www.sesse.net/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Douglas McNaught 2005-10-10 13:07:57 Re: How to delete Large Object from Database?
Previous Message Csaba Nagy 2005-10-10 12:02:32 Re: INSERT OR UPDATE?

Browse pgsql-performance by date

  From Date Subject
Next Message Stef 2005-10-10 12:57:00 Re: Compression of text columns
Previous Message Tino Wildenhain 2005-10-10 12:27:14 Re: Compression of text columns