pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jessica Richard <rjessil@yahoo.com>
To: pgsql-admin@postgresql.org
Subject: performance cost for varchar(20), varchar(255), and text
Date: Sat, 5 Jul 2008 04:19:52 -0700 (PDT)
Message-ID: <801541.60585.qm@web56406.mail.re3.yahoo.com> (raw)

I am tuning a database created by someone else.

I noticed that some column lengths were defined longer than needed.

For example, an Id column is holding a stand length of 20 characters but was defined as varchar(255).

On some other columns, for example, a Description column is supposed to hold less than 100 characters but defined as text.

I am trying to understand the performance impact if a column is over defined in the following cases:

1. char(20) vs varchar(20)

2. varchar(20) vs varchar(255)

3. varchar(255) vs text


thanks,
Jessica



      

view thread (3+ messages)  latest in thread

Message-ID: <801541.60585.qm@web56406.mail.re3.yahoo.com>
Permalink:  ../801541.60585.qm@web56406.mail.re3.yahoo.com/
Also on:    postgresql.org/message-id/801541.60585.qm@web56406.mail.re3.yahoo.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-admin@postgresql.org
  Cc: rjessil@yahoo.com
  Subject: Re: performance cost for varchar(20), varchar(255), and text
  In-Reply-To: <801541.60585.qm@web56406.mail.re3.yahoo.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