Skip site navigation (1) Skip section navigation (2)

Re: Size or efficiency differences "varchar(128) vs. varchar(32)"

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Size or efficiency differences "varchar(128) vs. varchar(32)"
Date: 2008-07-21 16:59:02
Message-ID: 4884C056.1050803@encs.concordia.ca (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-sql
Sorry, forgot to replay all.

> Emi Lu wrote:
> 
>> May I know does varchar(128) and varchar(32) will cause any size or  
>> efficiency differences?
> 
> None at all.


Basically, there is no efficiency differences at all, if I know a column 
is now varchar(32) but could be potentially increased to length(col)>32 
in the future, I will setup to varchar(128).

This column will be setup as varchar(128) everywhere so that foreign key 
constraints will work.

I had thought "foreign constraint, query or indexes" on varchar(32) 
could be more efficient than varchar(128) and I was wrong.

I will use varchar(128) for my column.

Thanks a lot!





In response to

pgsql-sql by date

Next:From: Milan OparnicaDate: 2008-07-21 20:45:36
Subject: Re: PERSISTANT PREPARE (another point of view)
Previous:From: Scott MarloweDate: 2008-07-21 16:17:04
Subject: Re: Size or efficiency differences "varchar(128) vs. varchar(32)"

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group