3 ms·
Database normalization has little to do with this. It's about structurally removing redundancy from your schema. Like not having the same column and data twice
by smueller1234 9y ago
Database normalization has little to do with this. It's about structurally removing redundancy from your schema. Like not having the same column and data twice in two tables. It's not going to do anything if you have two rows with common data such as two people with the same first name.
In the context of compression, dictionaries also don't generally correspond to a set of words or records per se but rather arbitrary (sub)strings or blobs.
- mbreese 9y agoI think they were trying to say if you had a normalized database where instead of repeated varchar fields, you had a foreign key — that would act like a dictionary. CREATE TABLE customer( id SERIAL, name VARCHAR(1024), status VARCHAR(1024) ) Vs CREATE TABLE customer( id SERIAL, name VARCHAR(1024), status INT REFERENCES status(id) ) CREATE TABLE status( id SERIAL, name VARCHAR(1024), ) It wasn’t very clear from the parent above, but I think this is where they were trying to go. The normalized version is smaller because you’ve swapped a repeated varchar ‘status’ for an int — so that’s effectively a dictionary. It’s not entirely correct, but it’s not that far off.
- smueller1234 9y agoThat makes sense, thanks for pointing out my misreading of the parent comment.