3 ms·
I 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 diction
by mbreese 9y ago
I 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.