List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:August 18 1999 8:52pm
Subject:Re: Storing GIF\'s in MySQL
View as plain text  
At 4:28 PM -0400 8/18/99, Urb LeJeune wrote:
>>> > Why? increadable waste of space and performance destroyer.
>>> >Why not just store a link?
>>>
>>> As for wasting space, every file in a file system has wasted space,
>>> unless it exactly fills up the last block allocated to it.  Why would
>>> MySQL be worse than the file system?
>
>	You're correct, it has to be stored somewhere, but store it 
>somewhere when
>its mere size doesn't degrade the performance of your DB. Let's assume that
>every row in your table averages a 60K gif. That's 60k the gets moved
>around almost every time you do a query, dump a table, etc. In addition,
>what do get from that field when you query it? Nothing iseful unless you
>take the gif and display it. On the other hand, if you use meaningful names
>like abc_co_logo.gif, you know exactly
>what it contains.

Thanks for your message, that's the kind of thing I was wondering about.
But let me play devil's advocate.

The size of the gif doesn't degrade the performance of the file system,
that's true, but the number of gif files does.  As you add gif files to
the file system, your lookup time increases, perhaps linearly depending
on how you arrange them in the file system and the intelligence of the
directory lookup routines.  This is not true when you're looking up images
in the database.

I don't understand why the 60K gets moved each time you do a query, unless
you select the field in which the gif is stored.  And you wouldn't do that
unless you wanted to do something with it, so you'd need to move that 60K
anyway.  Am I missing something here?

The 60K gets moved when you dump a table, true.  But it also gets 
moved when you
dump your file system, if the image is stored in a file.

As far as using meaningful names, there's nothing to stop you from storing
a meaningful name in the database rather than (or maybe in addition to)
a meaningless identification number.


>	You also create a maintenance nightmare. How do you handle a 
>changed gif?
>You have to upload it to your system, modify your table and get rid of the
>upoladed gif. If you only have a pointer and keep the same name, nothing
>has changes as far as the DB is concerned.

Isn't the maintenance nightmare primarily a function of the method you use
to update the gif?  What's to stop me from having a simple DBI script that
I can run on my client host that shoves the new gif across the wire in a query
that updates the table directly?  No need to upload the file, then get rid of
it after the update.

-- 
Paul DuBois, paul@stripped
Thread
Storing GIF\'s in MySQLGeocrawler.com18 Aug
  • Storing GIF\'s in MySQLsinisa18 Aug
  • Re: Storing GIF\'s in MySQLMartin Ramsch18 Aug
  • Re: Storing GIF\'s in MySQLUrb LeJeune18 Aug
    • Re: Storing GIF\'s in MySQLPaul DuBois18 Aug
    • Re: Storing GIF\'s in MySQLScott Hess18 Aug
      • Re: Storing GIF\'s in MySQLUrb LeJeune18 Aug
        • Re: Storing GIF\'s in MySQLVivek Khera18 Aug
        • Re: Storing GIF\'s in MySQLPaul DuBois18 Aug
          • Re: Storing GIF\'s in MySQLOliver Artelt18 Aug
            • Re: Storing GIF\'s in MySQLMartin Ramsch18 Aug
              • Re: Storing GIF\'s in MySQLOliver Artelt19 Aug
                • Re: Storing GIF\'s in MySQLPaul DuBois19 Aug
              • Re: Storing GIF\'s in MySQLTracy R Reed21 Aug
                • Re: Storing GIF\'s in MySQLsinisa21 Aug
      • Re: Storing GIF\'s in MySQLPaul DuBois18 Aug
    • Re: Storing GIF\'s in MySQLScott Hess18 Aug
    • Re: Storing GIF\'s in MySQLRonald Beck19 Aug
      • Re: Storing GIF\'s in MySQLPaul DuBois19 Aug
        • Re: Storing GIF\'s in MySQLPeter J. Schoenster19 Aug
          • Re: Storing GIF\'s in MySQLMartin Ramsch19 Aug
            • Re: Storing GIF\'s in MySQLBenjamin Pflugmann20 Aug
          • importing text file with mysqlimportBob C. Ruddy22 Sep
            • Re: importing text file with mysqlimportBob Kline22 Sep
              • Re: importing text file with mysqlimportBob Kline22 Sep
              • Re: importing text file with mysqlimportBob C. Ruddy22 Sep
                • Re: importing text file with mysqlimportMartin Ramsch23 Sep
                  • Re: importing text file with mysqlimportPaul DuBois23 Sep
                    • Re: importing text file with mysqlimportMartin Ramsch23 Sep
                      • Re: importing text file with mysqlimportPaul DuBois23 Sep
                        • Re: importing text file with mysqlimportPaul DuBois23 Sep
    • Re: Storing GIF's in MySQLCarsten H. Pedersen19 Aug
      • Re: Storing GIF's in MySQLMartin Ramsch20 Aug
  • Re: Storing GIF\'s in MySQLDavid Biro [DaV3|D3]19 Aug
Re: Storing GIF\'s in MySQLFrank Piwarski19 Aug
  • Re: Storing GIF\'s in MySQLStephen Johnston19 Aug
    • Re: Storing GIF\'s in MySQLshane19 Aug
    • Re: Storing GIF\'s in MySQLThimble Smith19 Aug
    • Re: Storing GIF\'s in MySQLaaron abelard19 Aug
Re: Storing GIF\'s in MySQLRaymond Gubala19 Aug
RE: Storing GIF's in MySQLHoward Lin20 Aug
  • Re: Storing GIF's in MySQLBenjamin Pflugmann20 Aug
  • RE: Storing GIF's in MySQLVivek Khera20 Aug
    • Re: Storing GIF's in MySQLMartin Ramsch20 Aug
  • Failing to unsubscribeJoel Palenychka22 Aug
  • Modifying SET columnsAndrian Pervazov22 Aug
    • Re: Modifying SET columnsPaul DuBois23 Aug
  • Re: Modifying SET columnsAndrian Pervazov23 Aug
    • Re: Modifying SET columnsBenjamin Pflugmann23 Aug
      • Re: Modifying SET columnsPaul DuBois23 Aug
  • Re: Modifying SET columnsGerald Clark23 Aug
  • Odd increments with mysql and php3.Matt Duggan24 Aug
    • Odd increments with mysql and php3.sinisa25 Aug
Re: Modifying SET columnsDave Kaufman23 Aug
  • Re: Modifying SET columnsPaul DuBois23 Aug