Unix Technical Forum

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

This is a discussion on Size or efficiency differences "varchar(128) vs. varchar(32)" within the pgsql Sql forums, part of the PostgreSQL category; --> Good morning, I'd like to create a varchar length column. May I know does varchar(128) and varchar(32) will cause ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Sql

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-22-2008, 06:59 AM
Emi Lu
 
Posts: n/a
Default Size or efficiency differences "varchar(128) vs. varchar(32)"

Good morning,

I'd like to create a varchar length column.

May I know does varchar(128) and varchar(32) will cause any size or
efficiency differences?

Thanks a lot!

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-22-2008, 06:59 AM
Alvaro Herrera
 
Posts: n/a
Default Re: Size or efficiency differences "varchar(128) vs.varchar(32)"

Emi Lu wrote:

> May I know does varchar(128) and varchar(32) will cause any size or
> efficiency differences?


None at all.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-22-2008, 06:59 AM
Scott Marlowe
 
Posts: n/a
Default Re: Size or efficiency differences "varchar(128) vs. varchar(32)"

On Mon, Jul 21, 2008 at 8:06 AM, Emi Lu <emilu@encs.concordia.ca> wrote:
> Good morning,
>
> I'd like to create a varchar length column.
>
> May I know does varchar(128) and varchar(32) will cause any size or
> efficiency differences?


If you store the same thing in each, no. If you store 128 char text
in the varchar(128) it will of course be bigger than a 32 char text in
the varchar(32) field.

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-22-2008, 06:59 AM
Emi Lu
 
Posts: n/a
Default Re: Size or efficiency differences "varchar(128) vs. varchar(32)"

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!





--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:35 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com