Handling of images via Postgressql

Handling of images via Postgressql

am 07.04.2010 14:50:13 von Suresh Borse

--=-ao1qcOrDTPbsNvK2j78A
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



How does PostGreSQL perform in case we have to store and use huge no of
images:

Eg 4000 â€=93 10000 images, each approx 2 MB size.

=20

The Questions that we have are:

How do we handle such huge no of images so that the application does not
slow down?

How does PostGreSQL use caching? In case of images does it cache?

Do you suggest having the images in a different database by itself?



Regards,

Suresh

--=-ao1qcOrDTPbsNvK2j78A
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit












How does PostGreSQL perform in case we have to store and use huge no of images:



 Eg 4000 – 10000 images, each approx 2 MB size.



 



The Questions that we have are:



How do we handle such huge no of images so that the application does not slow down?



How does PostGreSQL use caching? In case of images does it cache?



Do you suggest having the images in a different database by itself?







Regards,



Suresh



--=-ao1qcOrDTPbsNvK2j78A--

Re: Handling of images via Postgressql

am 07.04.2010 16:01:04 von tekniksupport

Suresh Borse skrev 2010-04-07 14.50:
>
>
> How does PostGreSQL perform in case we have to store and use huge no of
> images:
>
> Eg 4000 â€=93 10000 images, each approx 2 MB size.
>
>
>
> The Questions that we have are:
>
> How do we handle such huge no of images so that the application does no=
t
> slow down?
>
> How does PostGreSQL use caching? In case of images does it cache?
>
> Do you suggest having the images in a different database by itself?

I'd suggest storing meta information in PostgreSQL and the images in the=20
filesystem.

Regards,
roppert

>
>
>
> Regards,
>
> Suresh
>

--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: Handling of images via Postgressql

am 07.04.2010 16:26:50 von Kevin Grittner

Suresh Borse wrote:
=20
> How does PostGreSQL perform in case we have to store and use huge
> no of images:
>=20
> Eg 4000 * 10000 images, each approx 2 MB size.
=20
We have a database with a table containing 7.5 million rows, each
having an image in a bytea column. While the average size is only
15.2 kB, 69,000 of the rows are 2 MB or larger. Performance is
fine, but this is a pretty large machine.
=20
> How do we handle such huge no of images so that the application
> does not slow down?
=20
I would avoid doing a select of all 10,000 rows in a single result
set. If you're getting multiple images in a result set, you might
consider using a cursor.
=20
> How does PostGreSQL use caching?
=20
It has its own cache in shared memory, and also tends to use the
OS's cache -- just by virtue of doing the disk I/O through the OS.
=20
> In case of images does it cache?
=20
Yes.
=20
> Do you suggest having the images in a different database by
> itself?
=20
No. Well, not unless it is unrelated to other data in the database.
If it's related, you're going to want to define foreign keys, join
images to other data, and be able to have transactional integrity
between the images and other data. If you want those things, keep
them in the same database.
=20
-Kevin

--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: Handling of images via Postgressql

am 07.04.2010 18:21:28 von Bob Lunney

--0-1407091019-1270657288=:22026
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Suresh,
The real question is:  does manipulation of the images have to be tran=
sactional?  If so, store them in the database.  If not, store the=
images in the file system and put the file name in the database, thereby a=
voiding unecessary WAL overhead.
Bob Lunney

--- On Wed, 4/7/10, Suresh Borse wrote:

From: Suresh Borse
Subject: [ADMIN] Handling of images via Postgressql
To: pgsql-admin@postgresql.org
Date: Wednesday, April 7, 2010, 8:50 AM

=0A =0A =0A
=0A
=0AHow does PostGreSQL perform in case we have to store and use huge no of =
images:
=0A
Â=A0Eg 4000 â€=93 10000 images, each approx 2 MB size.
=0A
Â=A0
=0A
=0AThe Questions that we have are:
=0A
=0AHow do we handle such huge no of images so that the application does not=
slow down?
=0A
=0AHow does PostGreSQL use caching? In case of images does it cache?
=0A
=0ADo you suggest having the images in a different database by itself?
=0A
=0A
=0A
=0ARegards,
=0A
=0ASuresh=0A =0A
--0-1407091019-1270657288=:22026
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

top" style=3D"font: inherit;">Suresh,

The real question =
is:  does manipulation of the images have to be transactional?  I=
f so, store them in the database.  If not, store the images in the fil=
e system and put the file name in the database, thereby avoiding unecessary=
WAL overhead.

Bob Lunney

--- On Wed, 4/7/10, =
Suresh Borse <s.borse@direction.biz>
wrote:
style=3D"border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; paddin=
g-left: 5px;">
From: Suresh Borse <s.borse@direction.biz>
Subje=
ct: [ADMIN] Handling of images via Postgressql
To: pgsql-admin@postgresq=
l.org
Date: Wednesday, April 7, 2010, 8:50 AM

55121"> =0A =0A =0A
=0A
=0AHow does Po=
stGreSQL perform in case we have to store and use huge no of images:
=

=0A
=0A Eg 4000 â€=93 10000 images, each a=
pprox 2 MB size.

=0A
=0A 
=0A<=
br>=0AThe Questions that we have are:
=0A
=0A=
How do we handle such huge no of images so that the applic=
ation does not slow down?

=0A
=0AHow does Pos=
tGreSQL use caching? In case of images does it cache?

=0A
=0A<=
font size=3D"2">Do you suggest having the images in a different database by=
itself?
=0A
=0A
=0A
=0ARegards,=

=0A
=0ASuresh=0A
div>


--0-1407091019-1270657288=:22026--

Re: Handling of images via Postgressql

am 09.04.2010 22:46:27 von devrim

--=-sVue1Csr9pUe5P5SOU3a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, 2010-04-07 at 16:01 +0200, Robert Gravsjö wrote:
> > Do you suggest having the images in a different database by itself?
>=20
> I'd suggest storing meta information in PostgreSQL and the images in
> the filesystem.=20

Is this transaction safe?

--=20
Devrim GÜNDÜZ
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
PostgreSQL RPM Repository: http://yum.pgrpms.org
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz

--=-sVue1Csr9pUe5P5SOU3a
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEABECAAYFAku/kiIACgkQtl86P3SPfQ5ObwCggu7LtdrghLjeHAp65Z4o 93uM
mS8AoOr4eaiTB7KWOrM97TqbSr0UxC78
=oL07
-----END PGP SIGNATURE-----

--=-sVue1Csr9pUe5P5SOU3a--

Re: Handling of images via Postgressql

am 09.04.2010 22:57:52 von Kevin Grittner

Devrim GÜNDÜZ wrote:
> Robert Gravsjö wrote:

>> I'd suggest storing meta information in PostgreSQL and the images
in
>> the filesystem.=20
>
> Is this transaction safe?
=20
No.
=20
-Kevin

--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin