in reply to Re: What kind of database should I use?
in thread What kind of database should I use?

Denormalising data is a bad idea if you even want meanful data back out. I would add a table called file_types and use that as a primary key for a field added in your main table, for each file type you have create another table that holds information specific to that type. then just join to the appropriate tables based on the type indicated in the main table. This also give you a nice way to be able to filter based on file type without having to meddle with extensions etc
  • Comment on Re^2: What kind of database should I use?

Replies are listed 'Best First'.
Re^3: What kind of database should I use?
by Corion (Patriarch) on Feb 20, 2006 at 07:19 UTC

    I'm well aware of how it's "done right", but as I say in the documentation, this is the fifth generation and the contrast of doing the normalized queries and the denormalized queries was quite strong - the denormalized table allows me to formulate the queries in a very simple fashion, which was not possible with the normalized data. As the file types get saved in a separate column anyway (mime_type), querying by filetype doesn't imply mucking around with the extension either ;-). But most of that isn't obvious from what I said above, nor from the (lacking) documentation ...