Обсуждение: Storing text data in databases.

Поиск
Список
Период
Сортировка

Storing text data in databases.

От
mallah@trade-india.com
Дата:
Hi folks,
Is it a good idea to store large amount of text  ( ~ 5-10 K )  in
database
columns from performance point of view? or store the text in sperate
files and store the id of the file  in the databases.

Mallah.



Re: Storing text data in databases.

От
"Christopher Kings-Lynne"
Дата:
Hi Mallah,

Postgres 7.1 and above store large text fields (as type 'text') efficiently.
Just use Postgres and don't worry about it!  In fact, postgres itself stores
the large data in a separate table for just the performance reasons you
give!  However this is totally transparent to you, the user.

You can use the 'bytea' type for binary data of any size.

Chris

> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of
> mallah@trade-india.com
> Sent: Tuesday, 12 February 2002 1:40 PM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] Storing text data in databases.
>
>
> Hi folks,
> Is it a good idea to store large amount of text  ( ~ 5-10 K )  in
> database
> columns from performance point of view? or store the text in sperate
> files and store the id of the file  in the databases.
>
> Mallah.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>



Re: Storing text data in databases.

От
"Josh Berkus"
Дата:
Mallah,

> Is it a good idea to store large amount of text  ( ~ 5-10 K )  in
> database
> columns from performance point of view? or store the text in sperate
> files and store the id of the file  in the databases.

Thanks to the team's work on TOAST, performance is about equal.  Thereal question for you to answer is what better
suitsyour data?  Ifyou are using the database for version control, or to serve web pages,then I would say definitely in
thetable.  However, if this is adocument tracking database just designed to help you find papers, thenI would say use
linkedfiles.
 

If you store the data in the database, you may have to pay closeattention to your disk allocation.  If this database
seesheavy use,you may even need to move just that table to a seperate disk toprevent disk-access slowdowns.  Of course,
ifyou are using RAID-5,this is not an issue.
 

-Josh Berus


______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco