Assuming Hibernate creates varchar columns (rather than fixed length,
space padded char columns) there is no difference in storage or
performance. This page explains all of the details:
On Jun 18, 2006, at 9:30 PM, Damian C wrote:
> Question ONE: If we design a field (say) 50 characters long - and we
> have an instance/row using only (say) 20 characters - does Postgres
> "use" the whole 50, or only the 20??
> The issue here is a trade-off in how tightly we need to specify field
> lengths that we are currently unsure of. Are we wasting space if we
> make them large?
> Question TWO: When following typical Hibernate examples we notice that
> String fields are typically specified with a length at a "binary
> boundary". So they seem to always be specified at 16, 32, 64, 128
> etc. Really the question should be "is a String length 17 (or 33 or
> 65) significantly slower to insert/search/retrieve than a String of
> length 16 (or 32 or 64)?".
John DeSoi, Ph.D.
Power Tools for PostgreSQL
In response to
pgsql-novice by date
|Next:||From: Tom Lane||Date: 2006-06-19 02:23:24|
|Subject: Re: Postgres advice for Java/Hibernate project |
|Previous:||From: Richard Broersma Jr||Date: 2006-06-19 01:53:13|
|Subject: Re: Postgres advice for Java/Hibernate project|