Search Postgresql Archives

Re: [PERFORM] Text/Varchar performance...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Cristian,

> Hello, just a little question, It's preferable to use Text Fields or
> varchar(255) fields in a table? Are there any performance differences in
> the use of any of them?

TEXT, VARCHAR, and CHAR use the same underlying storage mechanism.   This 
means that TEXT is actually the "fastest" since it doesn't check length or 
space-pad.  However, that's unlikely to affect you unless you've millions 
of records; you should use the type which makes sense given your 
application.

For "large text fields" I always use TEXT.  BTW, in PostgreSQL VARCHAR is 
not limited to 255; I think we support up to 1GB of text or something 
preposterous.

-- 
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux