Re: Optimization of this SQL sentence

From: Mario Weilguni <mweilguni(at)sime(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Cc: Alexander Staubo <alex(at)purefiction(dot)net>, Ruben Rubio <ruben(at)rentalia(dot)com>
Subject: Re: Optimization of this SQL sentence
Date: 2006-10-17 15:29:19
Message-ID: 200610171729.19596.mweilguni@sime.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Am Dienstag, 17. Oktober 2006 11:52 schrieb Alexander Staubo:
> Lastly, note that in PostgreSQL these length declarations are not  
> necessary:
>
>    contacto varchar(255),
>    fuente varchar(512),
>    prefijopais varchar(10)
>
> Instead, use:
>
>    contacto text,
>    fuente text,
>    prefijopais text
>
> See the PostgreSQL manual for an explanation of varchar vs. text.

Enforcing length constraints with varchar(xyz) is good database design, not a
bad one. Using text everywhere might be tempting because it works, but it's
not a good idea.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Alexander Staubo 2006-10-17 15:32:12 Re: Optimization of this SQL sentence
Previous Message Craig A. James 2006-10-17 15:10:53 Re: Optimization of this SQL sentence