Re: Storing jpgs

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Storing jpgs
Date: 2004-04-08 15:24:00
Message-ID: 87hdvuh4rz.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Marek Lewczuk <newsy(at)lewczuk(dot)com> writes:

> On Apr 5, 2004, at 2:03 PM, Gavin M. Roy wrote:
>
> > I'm one for using base64 encoded text in a text field. It's easy to
> > deal with queries, it's easy to deal with spitting out images, and
> > it's easy to back up. Others do it differently, there are many ways to
> > skin a cat, and each person who skins cats most likely thinks their
> > way is best. Gavin
>
> Anyone knows what about performance of that kind of solution. Right now I'm
> storing all multimedia files on the disc, but I would be great if all files
> could be stored in DB (automatic remove, portability etc...). But the problem
> is with the size of all files - today it is about 5GB, so I belive that this
> can affect for overall DB performance. Any experiences ?

Well just having them in the database won't affect performance directly.

But there are indirect effects:

1) If you're accessing them regularly then the disk data will be cached by the
kernel just like other tables, and will contend with the much denser data
from your data tables.

2) Backups and restores will have to slog through that data as well and take
correspondingly longer.

> PS. My DB have 3 schemes where about 1 million different data are stored. I
> thought that it will be the best to create new scheme for storing files ?
> Right ? How about perfomance in this case ?

Schemas don't affect performance at all.

If you're debating between storing in the same table versus new identical
tables there could be pros or cons, but if it complicates your SQL it's
probably not worth it in any case.

--
greg

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2004-04-08 15:28:20 Re: Can we have time based triggers in Postgresql??
Previous Message Richard Huxton 2004-04-08 14:54:55 Re: Oid problem