Re: Field Size

Поиск
Список
Период
Сортировка
От Somasekhar Bangalore
Тема Re: Field Size
Дата
Msg-id BF493B193A334743AA9EF48945E69C13518E54@exchange.india.zensutra.com
обсуждение исходный текст
Ответы Re: Field Size
Список pgsql-admin

There is no harm in having a field size of 1000 character provided u use the proper datatype. Don’t user char(1000). Try using varchar(1000).

 

For character data it is recommended to use the VARCHAR type, since PostgreSQL manages it very well.  On the contrary, if you use the CHAR datatype, the size you specify for the string is pre-allocated in the pages and you allocate space which may not be used.  So your database is bigger than what it should be and performance is lowered, because this way you need more I/O to read the data.

 

Som

 

-----Original Message-----
From: Ganesan Kanavathy [mailto:ganesh@magnusquest.com]
Sent: Monday, December 08, 2003 6:26 PM
To: pgsql-sql@postgresql.org; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Field Size

 

Can anyone tell me, what harm would setting a field size to 1000 characters do to the size?

 

By increasing the size, will the database require more space? Or does it only consume space if there is data in the field only?

 

Regards,

Ganesan

 

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Marc A. Leith"
Дата:
Сообщение: Re: Field Size
Следующее
От: Ashok Chauhan
Дата:
Сообщение: timestamp field