Re: Postgres advice for Java/Hibernate project
От | Richard Broersma Jr |
---|---|
Тема | Re: Postgres advice for Java/Hibernate project |
Дата | |
Msg-id | 20060619015313.78661.qmail@web31810.mail.mud.yahoo.com обсуждение исходный текст |
Ответ на | Postgres advice for Java/Hibernate project ("Damian C" <jamianb@gmail.com>) |
Список | pgsql-novice |
> 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?? http://www.postgresql.org/docs/8.1/interactive/datatype-character.html It looks like either is possible depending upon the datatype that you choose for your field. > 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? it looks like char will use all of the field length by "padding" your value with additional spaces to complete the field length. > 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)?". I am not to sure here. If no one else respondes, you can always develop a test case around the type and quanity of data you are using to see if makes a difference. Regards, Richard Broersma Jr.
В списке pgsql-novice по дате отправления: