BLOB problem

Started by Rens Admiraalabout 22 years ago2 messagesgeneral
Jump to latest
#1Rens Admiraal
postgresnews@etraned.nl

Hi,

I've encountered a problem with a PostgreSQL database. I made a image
management system which stores images in a database from a PHP script. I
upload te file using pg_lo_import() (PHP function). Everything works
fine, fast, and I was really glad with it, till I found out that my
database is rapadly growing. With only 20 images the database has a size
of 65 MB !!!

Does anybody know where this come from ? I know I don't give a lot of
information, if you want more, ask for it. But I don't want to send
unreadable posts ;-)

Grtz

#2Doug McNaught
doug@mcnaught.org
In reply to: Rens Admiraal (#1)
Re: BLOB problem

Rens Admiraal <postgresnews@etraned.nl> writes:

I've encountered a problem with a PostgreSQL database. I made a image
management system which stores images in a database from a PHP script.
I upload te file using pg_lo_import() (PHP function). Everything works
fine, fast, and I was really glad with it, till I found out that my
database is rapadly growing. With only 20 images the database has a
size of 65 MB !!!

Are you running VACUUM regularly? You might want to do a VACUUM FULL
and see if the size goes down again.

The other possibility is that you're not dropping large objects when
they're superseded by new ones. If you never call lo_unlink() in your
code that's probably what's happening.

-Doug