Re: Postgres advice for Java/Hibernate project
От | John DeSoi |
---|---|
Тема | Re: Postgres advice for Java/Hibernate project |
Дата | |
Msg-id | EE7C30AD-7832-4B3B-897D-294ACCD3D4AC@pgedit.com обсуждение исходный текст |
Ответ на | Postgres advice for Java/Hibernate project ("Damian C" <jamianb@gmail.com>) |
Список | pgsql-novice |
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: http://www.postgresql.org/docs/8.1/interactive/datatype-character.html 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. http://pgedit.com/ Power Tools for PostgreSQL
В списке pgsql-novice по дате отправления: