X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 08AD08B9CA0 for ; Tue, 1 Feb 2005 15:01:58 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 81527-10 for ; Tue, 1 Feb 2005 15:01:43 +0000 (GMT) Received: from FS.denninger.net (wsip-68-15-213-52.at.at.cox.net [68.15.213.52]) by svr1.postgresql.org (Postfix) with ESMTP id A9D898B9C21 for ; Tue, 1 Feb 2005 15:01:45 +0000 (GMT) Received: from fs.denninger.net (localhost [127.0.0.1]) by FS.denninger.net (8.13.1/8.13.1) with SMTP id j11F1Q8m031513 for ; Tue, 1 Feb 2005 09:01:26 -0600 (CST) (envelope-from karl@FS.denninger.net) Received: from fs.denninger.net [127.0.0.1] by Spamblock-sys; Tue Feb 1 09:01:26 2005 Received: (from karl@localhost) by FS.denninger.net (8.13.1/8.13.1/Submit) id j11F1Fxm031511; Tue, 1 Feb 2005 09:01:15 -0600 (CST) (envelope-from karl) Message-ID: <20050201090115.A31386@denninger.net> Date: Tue, 1 Feb 2005 09:01:15 -0600 From: Karl Denninger To: Achilleus Mantzios , Dennis Sacks Cc: Sam Adams , pgsql-sql@postgresql.org Subject: Re: BLOBs vs BYTEA References: <41FEFCAA.5070603@illusions.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 0.93.2i In-Reply-To: ; from Achilleus Mantzios on Tue, Feb 01, 2005 at 10:04:45AM +0200 Organization: Karl's Sushi and Packet Smashers X-Die-Spammers: Spammers cheerfully broiled for supper and served with ketchup! X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200502/23 X-Sequence-Number: 20134 On Tue, Feb 01, 2005 at 10:04:45AM +0200, Achilleus Mantzios wrote: > O Dennis Sacks έγραψε στις Jan 31, 2005 : > > > Sam Adams wrote: > > > > >Anyway, I was wondering which would be a better way to store a large > > >amount of files each a few megabytes in size. There could be hundreds of > > >thousands of files altogether. If stored as BYTEAs this would put them > > >all in a single table. Would this effect performance considerablely? I > > >assume if there were thousands then it would. But if the data is stored > > >as BLOBs then aren't they store inside the database just in another > > >table? Wouldn't this also be undesirable. Would it be better to store > > >them normally on the file system and just provide the path and file name > > >in the database. Obviously this wont provide any security or backup but > > >would it make sense to do it this way with such a large amount of data? > > > > > > > > This is one of those age old debates. I've done both, and I'll tell you > > that in my experience it is less of a headache to store the files in the > > filesystem (which is what filesystems are designed for) and store the > > metadata in the database. > > I think if you are doing replication or write in java, > you'll be much happier with bytea. I store objects that are referred to in the database in the database. This requires some more work for binary objects in the application code, but not much. And, it insures that integrity is maintained. Otherwise you need a "cleanup" routine to cover the possibility of a file missing metadata, or metadata missing a file, along with all the replication/backup issues. No thanks on those for me. -- -- Karl Denninger (karl@denninger.net) Internet Consultant & Kids Rights Activist http://www.denninger.net My home on the net - links to everything I do! http://scubaforum.org Your UNCENSORED place to talk about DIVING! http://www.spamcuda.net SPAM FREE mailboxes - FREE FOR A LIMITED TIME! http://genesis3.blogspot.com Musings Of A Sentient Mind