Daniel Önnerby wrote:
Just out of curiosity.
If I for instants have 1000 rows in a table with a lot of blobs and a
lot of them have the same data in them, is there any way to make a
plugin to sqlite that in this case would just save a reference to
another blob if it's identical. I guess this could save a lot of space
without any fancy decompression algorithm, and if the blob-field is
already indexed there would be no extra time to locate the other
identical blobs :)
Daniel,
This is exactly what relational database normalization is about. If you
have many copies of the same blob you have redundant data. The best way
to handle that is to normalize the database by moving one copy of the
redundant data into a separate table. Then you store the id of that
record in the original tables where you need a reference to the data.
For blob data you would probably want to store a hash of the blob value
to speed comparisons, but this isn't absolutely necessary. You can
reconstruct the original data records by joining the original tables
with the new blob table when needed.
You can do it now without any new plugin for sqlite, and it works for
any relational database.
Normalization like this works just as well for non blob data.
Dennis Cote
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------